Access jar's resources within a servlet
Hello all :) first thanks for all the useful content I found on this forum.
I have a jar without classes, it contains only resources like images scripts etc. this jar is present in the dir WEB-INF/lib of my servlet.
How can I access the resources packed in the jar?
I searched but without success... Any help is appreciated.
Thanks, Roger
Re: Access jar's resources within a servlet
As a starter, have a look at http://download.oracle.com/docs/cd/E...r/JarFile.html
You can use a JarFile object to open up a jar file and read its entries.
// Json
Re: Access jar's resources within a servlet
If the jar file is on the classpath, you could use one of the getResource() or getResourceAsStream() methods.