If our resource is placeds inside of jar file,can we use ServletContext's method:
getresourceAsStream() to read it ? or should we use the classloader's J2SE 's getresourceAsStream() method?
Where is servlet context's getresourceAsStream() and getresouce() methods used? and how are they different from usage of J2SE counterparts?
posted 7 years ago
The ServletContext's methods work only for resources deployed in a webapp, but not within a JAR.
If you want to load the resource from the JAR, you'll have to use the J2SE methods.