Sunday, January 6, 2013

How to package JSF2 composite component as distributable JAR

The main purpose to package composite component is to share the copy of composite component(s) among other JSF2 project(s).

in this post, I will use the jQuery star rating in JSF2 as sample.

Tool: Eclipse

Platform: JSF2

1. create a new java project
    File > New > Java > Java Project > Next > Fill in project name > Finish
creating new project in Eclipse

2. in the new project, create a new folder called "META-INF"
creating META-INF folder

3. copy all required artifacts in resources into the META-INF folder

4. export this project as a JAR and deploy the JAR into project(s) classpath (/WEB-INF/lib folder in a web application) that are required this composite component.
adding the JAR to another project

5. using the composite component(s).
a. declare the namespace
declaring namespace of the composite component
b. calling the composite component
using the custom component

complete source


Once you have created and packaged the composite components, please refer the next step - How to declare custom namespace for composite components

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...