File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem accessing page inside /WEB-INF/

 
Timothy Sam
Ranch Hand
Posts: 751
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
logic:forward will work in this case, but logic:redirect will not.

Why?

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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic