Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2 visit the jsp in WEB-INF

 
wking qing
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
I want to protect my jsp ,so i put it into WEB-INF.

for example :

WEB-INF\upload\success.jsp

so i want to visit it by action result,like follows:


you may think it's ok,but the result is wrong.
because the struts2 will change the url to "application/upload/WEB-INF/upload/success.jsp",so it's a error url.
in other words ,the strus2 will change the url to "application/namespace/result location".
so if your namespace is not "/ " you will never visit the jsp in WEB-INF
you may think ,how about
namespace="/WEB-INF/upload"
and

then the url will be changed to "WEB-INF/upload/success.jsp",
but it's wrong too.
because namespace=" WEB-INF/..." is not available,so the action can't be visited.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic