我有 2 页:page1.xhtml、page2.xhtml。从第 1 页我转到第 2 页。在第 2 页我有:
<h:commandButton value="shuffle" action="#{bean.shuffle}" immediate="true"></h:commandButton>
当我将页面放入 WEB-INF 并单击随机播放时出现错误:
HTTP Status 404 -
--------------------------------------------------------------------------------
type Status report
message
description The requested resource () is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.14
但是当我将 page2 放在 WebContent 中时,一切正常。我的 web.xml :
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
为什么 ?