Once you have created few composite components for your company/project, probably you are thinking to declare a custom namespace for these composite components.
This post will show how to declare a custom namespace.
In this post, I will use the previous post - How to package JSF2 composite component as distributable JAR as sample program.
Steps
1. create a taglib.xml for existing composite components in the META-INF folder.
Content of the taglib.xml
http://kian/jsf/composite/cc - custom namespace, it could be http://your/company/cc
kian - a folder inside resources, the namespace above will looks for this folder inside resources
2. declare the namespace in XHTML and start using it
As an alternative for step 1, we can actually place the taglib.xml in the project workspace instead of bundle with the jar.
1. place the kian.taglib.xml in folder <WebContent>/WEB-INF
2. configure web.xml to read the kian.taglib.xml
Done!!
This post will show how to declare a custom namespace.
In this post, I will use the previous post - How to package JSF2 composite component as distributable JAR as sample program.
Steps
1. create a taglib.xml for existing composite components in the META-INF folder.
Content of the taglib.xml
http://kian/jsf/composite/cc - custom namespace, it could be http://your/company/cc
kian - a folder inside resources, the namespace above will looks for this folder inside resources
2. declare the namespace in XHTML and start using it
As an alternative for step 1, we can actually place the taglib.xml in the project workspace instead of bundle with the jar.
1. place the kian.taglib.xml in folder <WebContent>/WEB-INF
2. configure web.xml to read the kian.taglib.xml
Done!!
No comments:
Post a Comment