Resource in the WAR class directory or in any of the JAR files within the library directory may be accessed using J2SE sematics of getResource
This is one choice in a mock exam question, is this correct ?
The answer says yes, but is anyone could explain this for me ?
posted 11 years ago
This is because you can load all resources using getResource() which are in your application. If you use getSystemResource(), then your resurce must be in system classpath, but if it is in your app (inside war, which is deployed, i..e unarchuved), then classloaders of container can load it via getResource(). There are policies, how classloaders searches/loads resources.