aspose file tools*
The moose likes JSP and the fly likes Accessing JSP under WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Accessing JSP under WEB-INF" Watch "Accessing JSP under WEB-INF" New topic
Author

Accessing JSP under WEB-INF

Sameer Thapliyal
Greenhorn

Joined: Mar 12, 2008
Posts: 2
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

Joined: Oct 17, 2007
Posts: 42
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

Joined: Sep 01, 2003
Posts: 130
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


Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
http://www.socialinet.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
 
subject: Accessing JSP under WEB-INF