【发布时间】:2011-12-21 11:26:01
【问题描述】:
在 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> 中有没有办法做到这一点?我需要一些额外的框架吗?
【问题讨论】:
标签: java jsf web-applications servlets url-mapping