Re: Get an InputStream for a file in my webapp

2009-02-06 Thread Musachy Barroso
You can implement the ServletContextAware interface in your action, and Struts will set the ServletContext which has a "getPath" method, or something like that. musachy On Fri, Feb 6, 2009 at 9:03 AM, Security Management wrote: > I have an action that returns an image, and the getImageStream met

Re: Get an InputStream for a file in my webapp

2009-02-06 Thread Nils-Helge Garli Hegvik
Using a FileInputStream like that won't work if the war is packaged. Take a look at the getResourceAsStream method in the ServletContext interface instead. Nils-H On Fri, Feb 6, 2009 at 3:03 PM, Security Management wrote: > I have an action that returns an image, and the getImageStream method >

Get an InputStream for a file in my webapp

2009-02-06 Thread Security Management
I have an action that returns an image, and the getImageStream method returns the stream associated with the blob in the database that I'm pulling. That works great, and displays/exports the image exactly like I want to. However, there are cases where there is no image, and I want to display a "N