How does *.jsf is converted to *.xhtm in JSF

137 Views Asked by At

Im having JSF project in which i have xhtml pages. and my web.xml looks like below

<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>*.jsf</url-pattern>
</servlet-mapping>
<servlet>

Now when i hit the page like login.jsf, then it correctly loads login.xhtml. how does this happens ? Is this handled by FacesServlet ?

My another question is , Is FacesServlet and Facelets are same or different ? If different then what does Facelets means ?

1

There are 1 best solutions below

0
On

Faces servlet process all requests based on a define url-pattern redirecting these requests to JSF lifecycle.

Facelets is a templating framework that provides a XML based language to declare and compose view componentes in JSF.

Take a look at:

https://docs.oracle.com/javaee/7/api/javax/faces/webapp/FacesServlet.html http://www.oracle.com/technetwork/articles/java/facelets-454361.html