Posted by mriem
on November 20, 2013 at 12:58 PM PST
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog
If you want to share a composite component between projects you should package it in a JAR.
But how would you do it? Well it is pretty easy. First include the resources in the META-INF/resources directory. E.g.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This is coming from a JAR-packaged composite component! Hurray :)
And then add a faces-config.xml in the META-INF directory. E.g.
<?xml version='1.0' encoding='UTF-8'?>
And then JAR it all up.
Note the code for this sample is available as part of the Glassfish samples (see the subversion repository at https://svn.java.net/svn/glassfish-samples~svn/trunk/ws/javaee7/jsf/packageCompositeComponent/ )
And that is it.