Java Reference
In-Depth Information
Listing 6-4. web.xml
1. <web-app ... .. >
2. <display-name>helloWorldJSF</display-name>
3. <welcome-file-list>
4. ...
5. </welcome-file-list>
6. <servlet>
7. <servlet-name>Faces Servlet</servlet-name>
8. <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
9. <load-on-startup>1</load-on-startup>
10. </servlet>
11. <servlet-mapping>
12. <servlet-name>Faces Servlet</servlet-name>
13. <url-pattern>/faces/*</url-pattern>
14. </servlet-mapping>
15. <servlet-mapping>
16. <servlet-name>Faces Servlet</servlet-name>
17. <url-pattern>*.faces</url-pattern>
18. </servlet-mapping>
19. <context-param>
20. <description>State saving method: 'client' or 'server' (=default). See JSF Specification
2.5.2</description>
21. <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
22. <param-value>client</param-value>
23. </context-param>
24. <context-param>
25. <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
26. <param-value>resources.application</param-value>
27. </context-param>
28. <listener>
29. <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
30. </listener>
31. </web-app>
Lines 11 to 14 : The servlet-mapping element makes certain that all URLs with
the prefix /faces are processed by FacesServlet .
Lines 15 to 18 : The servlet-mapping element makes certain that all URLs ending
with the faces extension are processed by FacesServlet .
Figure 6-13 shows the directory structure of the Hello World web application.
 
Search WWH ::




Custom Search