Servlet containers and classpath

The "dynamic" classpath will list WEB-INF/classes and each JAR file under WEB-INF/lib as a separate entry. Other folders under WEB-INF are not included.

In your example, bar.properties will not be on the classpath. Move it to WEB-INF/classes, or put it inside a JAR file under WEB-INF/lib.

What's in the rest of the classpath depends on your servlet container. It is implementation-specific, but most containers have two other places to put classes. One is a directory that is visible to the container, but not the applications, and the other is visible to the container and all of the applications. Since the second classloader is visible to all of the applications, static members of those classes can be used to share information between applications.


In your example bar.properties would need to be under the classes directory to be in the classpath.