Learn Java for Web Development

(Tina Meador) #1

276 CHAPTER 6: Component-Based Web Development Using JSF 2


Listing 6-4. web.xml



  1. <web-app ..... >


  2. helloWorldJSF




  3. ...








  4. Faces Servlet


  5. javax.faces.webapp.FacesServlet


  6. 1








  7. Faces Servlet


  8. /faces/*








  9. Faces Servlet


  10. *.faces








  11. State saving method: 'client' or 'server' (=default). See JSF Specification
    2.5.2



  12. javax.faces.STATE_SAVING_METHOD


  13. client








  14. javax.servlet.jsp.jstl.fmt.localizationContext


  15. resources.application








  16. com.sun.faces.config.ConfigureListener








   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.

Free download pdf