• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

true or false, getResource sematic

 
tiim fei
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

Thanks
 
Saulius Sinkunas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic