Component Pack Howto

Introduction

Component packs are a way to capsule components into a single jar library. The user can download it, dump it into the WEB-INF/lib and start to use the components instantly by including the tld in the page header.

How to create one

A component pack is a single jar file with the class files for the components, a single faces-conf.xml with the needed description for the JSF system and the TLDs for the tag lib inclusion.

There is an enforced filestructure every component pack has to follow.

/META-INF
/<your class packages>

The File structure can be split into following subfiles and subdirectories

/META-INF
/META-INF/faces-config.xml
/META-INF/thetld.tld
/META-INF/<whatever is needed also by the files (additional xml files entity files etc)>
/<packages with the class files for the components>

This structure has to be jarred with your preferred jar tool and the component pack should work as described above.

"Note" there is a huge difference to runtime jar files, you dont need a manifest file to make a working jar, dumping the config file stuff into /META-INF and packaging it with the tool of your choice (plain jar, Ant, even a jar export from Eclipse) works in any case.

  • No labels