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: 197
posted
0
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
posted
0
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: 197
posted
0
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: 35258
7
posted
0
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).
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.