开发者

How can I make JSF 2.0 page with .jsf extension?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜