Andy Jefferson wrote:
>
> Simple one. How to access a particular image file via a servlet ...
>
> For example I have a servlet in
>
> /home/httpd/servlets/uk/co/demon/ajsoft/Invoice/
>
> and images in
>
> /home/httpd/servlets/uk/co/demon/ajsoft/Invoice/images/
>
> so if I want to access 'delete.gif' from the images directory, what do I need to
> put in the response HTML to find it ?
>
> If I do things like
>
> <IMG SRC="uk/co/demon/ajsoft/Invoice/images/delete.gif">
>
> it is rewritten as /uk/co/demon/ajsoft/Invoice/images/delete.gif
>
> or if I do
>
> <IMG SRC="../uk/co/demon/ajsoft/Invoice/images/delete.gif">
>
> it is rewritten as /servlets/uk/co/demon/ajsoft/Invoice/images/delete.gif
>
> TIA
> --
> Andy
Hi Andy
Your image file has to live in the webserver directory, not in the servlet directory.
So use somthing like:
/usr/local/apache/htdocs/ajsoft/images/delete.gif
To store the gif, and use:
<IMG SRC="/ajsoft/images/delete.gif">
to give it back to the client.
Tschau
Christian
----------------------------------------------------------------
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]