Is the WEB-INF
folder in the CLASSPATH
of a Java Web application?
Asked
Active
Viewed 3.8k times
57

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 Answers
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
.

Christian Conti-Vock
- 252
- 1
- 3
- 15

Jack Leow
- 21,945
- 4
- 50
- 55
-
8If /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
-
Unless you forward the request (although BEA had a broken implementation of this many years ago). – Tom Hawtin - tackline Apr 27 '09 at 15:37
-
1