开发者

JSF 2.0 javax.faces.webapp.FacesServlet mappig

开发者 https://www.devze.com 2023-04-11 02:10 出处:网络
I started to use JSF 2.0 recently and I don\'t understand completely how I need to configure the javax.faces.webapp.FacesServlet to correctly handle resources.

I started to use JSF 2.0 recently and I don't understand completely how I need to configure the javax.faces.webapp.FacesServlet to correctly handle resources. For example, If I decided to create a web开发者_JS百科 application with .xhtml files and .jsp files and I want both them to use jsf technology how am I supposed to configure the jsf servlet to handle both? Sometimes I found example where the servlet url pattern is just /faces/* thanks!


I suggest to use a suffix pattern as URL pattern like *.jsf. If a Facelets file (.xhtml) is present on the given view ID, then it will be served. Otherwise if a JSP file (.jsp) is present on the given view ID, then it will be served. This also gives you the room to gradually upgrade from JSP to Facelets without the need to change URLs, so that you can ultimately get rid of those legacy JSPs in an easy way.

0

精彩评论

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