• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing JSP under WEB-INF

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic