57

Is the WEB-INF folder in the CLASSPATH of a Java Web application?

Shyam Kumar Sundarakumar
  • 5,649
  • 13
  • 42
  • 69
  • This question seems to ask a similar thing: http://stackoverflow.com/questions/305285/servlet-containers-and-class-path – andri Apr 27 '09 at 15:03

2 Answers2

77

I'm assuming you're referring to the /WEB-INF directory in the root of the web application folder structure.

No, it's not in the classpath.

/WEB-INF/classes is on the classpath though, and so are the JAR files in /WEB-INF/lib.

Jack Leow
  • 21,945
  • 4
  • 50
  • 55
  • 8
    If /WEB-INF is not on the classpath, then why are the official 'deployment descriptor files' , such as web.xml , in that folder? Do they still get loaded somehow even if they are supposedly not on the classpath? – djangofan Dec 29 '15 at 00:21
12

Additionally files in WEB-INF are protected against being requested by the web-container, i.e. they are invisible to the outside world.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347