File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem accessing page  inside  /WEB-INF/ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem accessing page  inside  /WEB-INF/" Watch "problem accessing page  inside  /WEB-INF/" New topic

problem accessing page inside /WEB-INF/

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Hi, I access a page inside /WEB-INF/ by invoking the struts-logic tag

<logic:redirect forward="showMenu"/>

I put it in /WEB-INF/ folder so it wouldn't be accessible for the user. But I believe I should still be able to go to the page using the <logic:redirect forward="showMenu"/> tag... I am able to go to pages inside /WEB-INF/ directory if I came from an ActionServlet mapping.findForward(). Here is the error message that I get

HTTP Status 404 - /AssetManagementSystem/WEB-INF/cpanel.jsp


type Status report

message /AssetManagementSystem/WEB-INF/cpanel.jsp

description The requested resource (/AssetManagementSystem/WEB-INF/cpanel.jsp) is not available.


Apache Tomcat/5.0.27

The file is there of course, I checked on it and it exists. Any help? Thanks!

SCJP 1.5
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
logic:forward will work in this case, but logic:redirect will not.


Because this tag causes a request.sendRedirect() to be performed. What this does is send a command back to the browser to go to a different URL. Because the URL you gave is inside WEB-INF, the browser can't access it. A forward, on the other hand, simply passes control to another page without going back to the browser, and therefore is able to access pages inside the WEB-INF directory.

Consultant, Sima Solutions
I agree. Here's the link:
subject: problem accessing page inside /WEB-INF/
It's not a secret anymore!