In order to use Facelets within a JSF application, we need to make several configuration changes to the web.xml
and faces-config.xml
files.
Within the web.xml
file, we need to configure the default suffix for our web pages to be .xhtml
. This is achieved by setting the javax.faces.DEFAULT_SUFFIX
initialization parameter. A minimal web.xml
file would look similar to the following:
<?xml version="1.0" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<listener>
<listener-class>
org.jboss.seam.servlet.SeamListener
</listener-class>
</listener>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<...