On Apr 2, 2005 8:53 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> i need to load a bunch of image files located outside my exploded war
> file.  for example, say that the images live here
> 
> |---c:\myimages
> |-----------\app
> |-----------------\promotions
> |-------------------------\images
> 
> & my app is under
> 
> |---c:\tomcat5.5
> |----------\webapps
> |--------------------\myapp.
> 
> the img links are written out dynamically based on an init-param in the
> web.xml & javabeans.   the result is that i can get a valid path to the
> image resouce looking at the html, but cannot actually load the image.
> 
> does anyone know if that's possible on the windows platform (win2k
> server)?
> 
> thanks
> 
> 

A relative link will work if it is inside the web application root. 
    If you want to load external images write a Servlet to which the
path or name of the image file is passed as an argument and the
Servlet reads the file using ServletContext.getResourceAsStream() and
write it to the OutputStream returned by the
response.getOutputStream(). Dont forget to set the appropriate MIME
type for content type.

-- 
Anto Paul
Benchmark Softech
www.benchmarksoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to