在 JSF 应用程序中,我们有目录层次结构:
webapp
xhtml
login.xhtml
main.xhtml
search.xhtml
css
main.css
extra.css
js
jquery.js
等等。servlet 映射是:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
这工作正常,但我们的网络应用程序的 URL 如下所示:
http://localhost/myapp/xhtml/login.xhtml
http://localhost/myapp/xhtml/search.xhtml
我们希望通过删除/xhtml
部分来获得更简单的 URL,即
http://localhost/myapp/login.xhtml
我找不到任何方法来实现这一点。有没有办法做到这一点<servlet-mapping>
?我需要一些额外的框架吗?