Question

I have 2 pages: page1.xhtml, page2.xhtml. From page1 I go to page2. In page2 I have:

<h:commandButton value="shuffle" action="#{bean.shuffle}" immediate="true"></h:commandButton> 

When I put page in WEB-INF and clicking on shuffle I get error:

    HTTP Status 404 - 

--------------------------------------------------------------------------------

type Status report

message 

description The requested resource () is not available.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.14

But when I put page2 just in WebContent, everything works good. My web.xml :

  <servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

Why ?

Was it helpful?

Solution

Resources in /WEB-INF are not publicly accessible. You need to put publicly accessible resources outside /WEB-INF. The /WEB-INF should only be used for configuration files, template files, include files, tag files, etc which are supposed to not be publicly accessible at all.

See also:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top