April 2004
Intermediate to advanced
606 pages
20h 4m
English
Example F-3 shows an example of a deployment descriptor (web.xml) file with the most common declarations needed for a JSF- application.
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<servlet>
<servlet-name>facesServlet</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>facesServlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
</web-app>At the top of the file, you find a standard XML declaration and the
<web-app> element, with the reference to the
deployment descriptor schema. Next comes a
<context-param> element that tells JSF to
save state in the client. The <servlet>
element maps the JSF servlet class to a name, and the
<servlet-mapping> element maps the servlet
to the recommended *.faces extension pattern.
Read now
Unlock full access