Documentation
FaceletsTools

Search 

Contents

1. Introduction
2. Getting Started
Selected 3. Facelets Concepts
4. Document Types
5. Design View Support
6. Code View Support
7. Keyboard Shortcuts
8. Tag Object Toolbars
9. Property Inspectors
10. Facelets Tag Reference

3. Facelets Concepts

Contents > Facelets Concepts > Facelets Configuration

Adding Facelets to your Faces Configuration File

The Facelets view handler is a pluggable component that can be easily added to a Web application using the JavaServer Faces (JSF) framework. Facelets is capable of rendering JSF pages written in XML-compliant markup, and also builds a component tree for each view in a very flexible way.

To begin using Facelets, add the following to your Faces configuration file:

faces-config.xml

<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>

Configuring your Web Application for Facelets UI Development

The Faces servlet can be mapped to any file extension, but we recommend the *.jsf extension. New Facelets XHTML pages created in Dreamweaver with FaceletsTools will use this file extension. The following example configures both the Faces servlet and Facelets to use the *.jsf extension, and enables rapid application development features:

<!-- Web application context parameters -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jsf</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>1</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>facelets.VIEW_MAPPINGS</param-name>
<param-value>*.jsf</param-value>
</context-param>

<!-- Faces servlet mapping -->
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping> <servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

More Information

For more information on Facelets configuration and usage, please see the official Facelets documentation at:

https://facelets.dev.java.net/nonav/docs/dev/docbook.jsf