The default one is xhtml. I want to change it to .jsf.
Is this possible using facelets/jsp or using an开发者_JAVA技巧yone of these two?
I think your asking about changing the servlet mapping so you can go to http://website/index.jsf instead of something like http://website/faces/index.xhtml. To do this change your url-pattern in your web.xml .
<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>
I didn't have to change the .xhtml file extension of the index file in my project for this to work.
精彩评论