File Redirection in Tomcat 5.5

I've got an application that reads from a collection of data in a

directory outside the WEB-INF directory. I am able to read the data

and use it to create an html stream to send to the user. This part is

working well.

Now, I'd like to include graphics (jpegs, for example), and when I

build <img> elements that have links to the real location of the

graphic (with file:///c:/wherever/my.jpg) they work in IE and fail in

Firefox. My thought is that FireFox is asking Tomcat for the graphics

file and it is trying to find it relative to the WEB-INF directory,

and failing.

Is there a way to spacify a mapping capability for images in Tomcat?

Is there a way to have some servlet code to receive requests for an

image, locate the file and pass it to the browser?

Thanks.

Dave Patterson

[894 byte] By [d.pattersona] at [2007-11-26 21:39:07]
# 1

> graphic (with file:///c:/wherever/my.jpg) they work

> in IE and fail in

> Firefox. My thought is that FireFox is asking Tomcat

> for the graphics

> file and it is trying to find it relative to the

> WEB-INF directory,

> and failing.

>

:-) , everything executes on the server and the end-results (HTML , Javascript) are sent back to the browsers.

Server-side code is completely independent of client-side browsers. The browsers only see HTML, Javascript, CSS and other client-side code. The Java , and other server side code is not at all visible to browsers.

> Is there a way to spacify a mapping capability for

> images in Tomcat?

>

Not sure about this, but you can check with Tomcat's user mailing list:

http://tomcat.apache.org/lists.html

appy77a at 2007-7-10 3:22:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...