Is WEB-INF in the CLASSPATH?

JavaClasspathWeb Inf

Java Problem Overview


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

Java Solutions


Solution 1 - Java

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.

Solution 2 - Java

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionShyam Kumar SundarakumarView Question on Stackoverflow
Solution 1 - JavaJack LeowView Answer on Stackoverflow
Solution 2 - JavaThorbjørn Ravn AndersenView Answer on Stackoverflow