Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing JSP under WEB-INF

 
Sameer Thapliyal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to access jsp page through URL, which is under WEB-INF folder.According to my projects requirement all JSP are under WEB-INF folder like-web/WEB-INF/JSP/login.jsp.I have tried <jsp-file> tag in .xml but its not working.Please provide me some solution.
 
Gayathri Chowduru
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In web.xml, give your jsp file name for eg, index.jsp like

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

try like that.

Thanks,
Gayathri.
 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sameer Thapliyal

JSPs are the public part of the project and it should be outside tie WEB-INF folder.

Like in case of applet the Applet class are package out side the WEB-INF so the it can execute on the client side.

Simply you cannot put JSP inside WEB-INF folder
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sameer Thapliyal:
I want to access jsp page through URL, which is under WEB-INF folder.According to my projects requirement all JSP are under WEB-INF folder like-web/WEB-INF/JSP/login.jsp.I have tried <jsp-file> tag in .xml but its not working.Please provide me some solution.


"It's not working" doesn't give us much in the way of information.
Are you saying you created a servlet entry with with a jsp-file attribute?
If so, did you also create a mapping for that JSP?

Typically, when the requirements specify that all JSPs are to go under WEB-INF it's because the project is using an MVC architecture. In this case, the JSPs shouldn't be accessed directly at all.

If you give us some more information about what you're trying to to we might be able to give you some more useful information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic