File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Access pages in WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Access pages in WEB-INF" Watch "Access pages in WEB-INF" New topic

Access pages in WEB-INF

Abiodun Okusolubo
Ranch Hand

Joined: Apr 25, 2004
Posts: 72
Hello Ranchers, I need assitance on how one can use page-navigation to access .jsp pages within the WEB-INF folder.

Any kind of support will be appreciated.


SCJP, SCWCD, SCJD : in the making.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
I'm not sure if I understand the question correctly. But you are not supposed to put viewable pages to WEB-INF folder. WEB-INF folder contains normally java classes, jar libraries and configuration files put nothing that is supposed to go to the client.
JSP pages are put to webapp folder or to subfolder of webapp (other than WEB-INF).
Abiodun Okusolubo
Ranch Hand

Joined: Apr 25, 2004
Posts: 72
Usually some pages are kept within the WEB-INF folder, this however, is to apply security to the pages.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
Ah yes. I've read about that. But isn't that non standard feature that not all webcontainers allow?
How about applying security constraints to normal folder instead (with web.xml)?

Well I really am not familiar with this subject so I will shut up now
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41123
The servlet specification makes it clear that nothing gets served out of WEB-INF. So it's not possible to access JSP pages inside of WEB-INF directly, e.g. by entering their URL into a browser.

What is possible is to use those JSP pages indirectly, e.g. by including them or forwarding to them using a RequestDispatcher. I would imagine that that's what the JSF page-navigation does (not sure about it, though).

Ping & DNS - my free Android networking tools app
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Personally I strongly discourage trying to serve JSP files from the WEB-INF directory. Since support for this is not defined in the specification it cannot be guaranteed and may change between servers or versions (some versions of Tomcat prevent this)

If you want to prevent direct access to JSPs or other resources in production, consider doing it through Apache.
I agree. Here's the link:
subject: Access pages in WEB-INF
Similar Threads
how to access jsp under WEB-INF folder
hiding pages behind WEB-INF?
Saving your jsp pages in WEB-INF
struts 1.beginner, code not working
ModelDriver Interceptor + not getting my object