• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Accessing JSP under WEB-INF  RSS feed

 
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.
 
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.
 
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
 
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.
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!