In the previous blog entry we set the stage on how to package a composite component in a JAR. Now we are going to use it!
Add the dependency to the POM
<dependency> <groupId>myGroupIdf</groupId> <artifactId>myPackagedCompositeComponent</artifactId> <version>${project.version}</version> </dependency>
Use it in the page
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:mypanel="http://java.sun.com/jsf/composite/mypanel"> <h:head> <title>Composite component</title> </h:head> <h:body> <h2>Composite component</h2> <mypanel:mypanel/> </h:body> </html>
Posted November 21, 2013