This section will perform you all concepts that JBDS involves to use the Facelets.
The Facelets extends JavaServer Faces by providing a lightweight framework that radically simplifies the design of presentation pages for JSF. JBoss Developer Studio provides support for Facelets in a variety of ways:
The New JSF Project wizard contains templates for creating Facelets projects based on version 1.2 of the JSF Reference Implementation. Select the JSF 1.2 with Facelets in JSF Environment section.
Once you select the environment, you can specify the one of three available templates:
The fallowing table lists possible Facelets templates for any JSF project and gives a proper description for each one.
Template |
Description |
---|---|
FaceletsBlankWithoutLibs |
Some servers already provide jsf libs and you take risk of getting conflicting libraries while deploying your project. To avoid such conflicts, use a template without libs if you have a server with its own jsf libraries |
FaceletsKickStartWithRILibs |
a sample application with Facelets that is ready to run |
FaceletsKickStartWithoutLibs |
a sample application without libraries |
Table 2.1. Facelets Templates
The JBoss Tools Palette comes with the Facelets components ready to use. A useful tip appears when you hover the mouse cursor over the tag, the tip includes a detailed description of the tag component, the syntax and available attributes.
Code assist (Ctrl + Space) for Facelets tags is available when editing .xhtml files.
What's more, code assist is also available for "jsfc" attribute in any HTML tag.
After selecting "jsfc" you get the code assist for JSF components available on a page.
When a component is chosen you will see all available attributes for it.
JBDS provides Eclipse's OpenOn feature for editing Facelets files. Using this feature, you can easily navigate between the Facelets templates and other parts of your projects. Just by holding down the Control key while hovering the mouse cursor over a reference to a template, the reference becomes a hyperlink to open that template.