0

In web.xml, I had found the declaration for the initial web page as follows.

<welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>

Where is face in Java Web application? I have known that index.xhtml is located in Web Pages folder.

enter image description here

ducanhnguyen
  • 161
  • 1
  • 10
  • `/faces`, `*.jsf` and `*.faces` are automatically mapped by [`FacesServlet`](https://docs.oracle.com/javaee/7/api/javax/faces/webapp/FacesServlet.html). "*If the runtime determines that the Servlet must be automatically mapped, it must be mapped to the following `` entries - `/faces`, `*.jsf`, `*.faces`.*" Thus, they are implicit in case `FacesServlet` is not explicitly registered (which happens, if certain criteria meet as specified in the documentation). – Tiny Oct 29 '15 at 07:24

1 Answers1

1

if you opened web.xml you will find mapping of /faces/* url to servlet that contain life cycle of JSF and managed by that servlet

as any page goes in JSF life cycle must be under/faces/

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
azza abady
  • 26
  • 5