Is WEB-INF in the CLASSPATH?
Asked Answered
M

2

57

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

Mooned answered 27/4, 2009 at 15:1 Comment(1)
This question seems to ask a similar thing: #305785Actinism
G
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.

Georgeannageorgeanne answered 27/4, 2009 at 15:3 Comment(1)
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?Plesiosaur
M
12

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

Mobile answered 27/4, 2009 at 15:13 Comment(2)
Unless you forward the request (although BEA had a broken implementation of this many years ago).Mistrot
You can almost always circumvent protection.Anticipatory

© 2022 - 2024 — McMap. All rights reserved.