• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding a Plugin - Jsp in pages folder

 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

while creating new plugins in Struts, why is it mandatory for jsp's to be in pages directory.

If I create a folder called "ast" under WEB-INF and keep the jsp page in this new folder under WEB-INF (WEB-INF\ast), I am not able to run the jsp page from the url

http://localhost:8080/strutstutorial/WEB-INF/ast/plugin.jsp

Rgds,

Seetesh
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole reason for putting JSPs under the WEB-INF/ directory is so that they cannot be accessed directly through a URL.

The J2EE specification for web containers dictates that anything put in WEB-INF or its child directories cannot be accessible through a URL. The reasoning for putting pages there is that it isn't a good idea for a user to be able to call a JSP page directly by name. This makes it so that the only way to reach /WEB-INF/xyz.jsp is by calling an action or Servlet that forwards to it (xyzAction.do).
[ October 17, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic