Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSPs under the WEB-INF dir is OK

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing this is meant as a reply to another post ... ?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic