aspose file tools*
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Access pages in WEB-INF" Watch "Access pages in WEB-INF" New topic
Author

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.

Thanks


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

Joined: Apr 15, 2008
Posts: 198
Hi
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
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
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
Rancher

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: http://aspose.com/file-tools
 
subject: Access pages in WEB-INF