aspose file tools*
The moose likes Servlets and the fly likes JSPs under the WEB-INF dir is OK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSPs under the WEB-INF dir is OK" Watch "JSPs under the WEB-INF dir is OK" New topic
Author

JSPs under the WEB-INF dir is OK

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I was wrong, it appears that the Servlet Spec does dictate the behaviour of accessing JSP resources from the WEB-INF directory. Specifically:
(taken from the Servlet 2.4 Spec SRV.9.5)
However, the contents of the WEB-INF directory are visible to servlet code using the getResource and getResource-AsStream method calls on the ServletContext, and may be exposed using the RequestDispatcher calls.

Thanks Brad
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
I'm guessing this is meant as a reply to another post ... ?


Ping & DNS - updated with new look and Ping home screen widget
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Nope. Atleast not a recent one.

I have been against placing JSPs in the WEB-INF directory. Not because it didn't work, but because no-one could show where it was defined in the Spec. If it is not specified officially, then it is a vendor feature and should not be used.

Now that I have a quote I apologise and admit my mistake
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSPs under the WEB-INF dir is OK
 
Similar Threads
Web-App Directory Structure!
Question Bank ID : 36
Accessing a file under WEB-INF using getResource()
Lost properties
JSP hiding