Re: Solution for finding images in a WAR file

2003-01-21 Thread Johan Åbrandt
This solution may or may not work in existing servers, but it may also break. The problem is that ServletContext-getRealPath() is allowed to return null, for example if the content is served from a WAR. Rakesh Patel wrote: Hi, I have found a solution that I think works (have not got access to a

Re: Solution for finding images in a WAR file

2003-01-21 Thread Johan Åbrandt
(1) Where is the ContextClassloader? (2) Why do you assume that the ResourceLoader is loaded by the same classloader as the calling class? Sharma, Siddharth wrote: Try using this file for loading resources. Currently it loads only as properties and String but you may choose to return anyway you

RE: Solution for finding images in a WAR file

2003-01-20 Thread Sharma, Siddharth
Try using this file for loading resources. Currently it loads only as properties and String but you may choose to return anyway you want. import java.util.Properties; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.ByteArrayOutputStream; /**