Willa Zhu wrote:
> >
> > The browser will understand that your servlet will supply that gif too. Give
> > them the full path/url to that gif.
>
> I know it works when I use <IMG SRC="http://www.mydomain.com/thepath/myfile.gif"
> ...>, but I wonder if I can use relative path name which is what I prefer.
>
If you have a servlet that is accessed at path
http://www.mydomain.com/servlet/myservlet
and you generate a relative URL for an image "images/logo.gif" for example, then
(by the rules of HTTP) the path that the browser sees becomes:
http://www.mydomain.com/servlet/myservlet/images/logo.gif
Because of the first part, Apache invokes your servlet again, with the value
returned by request.getPathInfo() set to "/images/logo.gif". Therefore, the only
way to use a relative URL like this is if your servlet itself serves the image file
in this latter case. You can certainly do that, but performance would be improved
if you used an absolute path to an images directory that Apache was serving itself.
Craig McClanahan
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]