Aram Gevorgyan
Aram Gevorgyan

Reputation: 2205

Tomcat: The requested resource () is not available

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 ?

Upvotes: 1

Views: 5356

Answers (1)

BalusC
BalusC

Reputation: 1108842

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:

Upvotes: 2

Related Questions