Well, If your image locates like below

/webapps
    /your_Appln
        /webinf
            ....
                 related class files
            ....
        /images
            ....
                place all the image files here
            ....
then try the url mapping using "../images/imagename". Hope it'll work, b'cas
I'm using  "  url(../images/bg1.jpg)  " in my stylesheet. Note I'm using two
periods.

Here is some patches    :
Insdide Servlet
      pw.println("<html><head><LINK href='../style/mystyle.css'
rel=stylesheet type=text/css></head>");

In Style Sheet

        body
        {
             background: url(../images/bg1.jpg) fixed
        }
        a
        {
             text-decoration:none
        }

Rgds
Vijay

----- Original Message -----
From: "G.Nagarajan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 1:14 PM
Subject: RE: Image file not found - why not ?


> hi,
> try the following
> - check the case of the file name, example myimage.jpg instead of
> MyImage.jpg
> - try giving /webapp/images/MyImage.jpg
> - check if you can directly access the image by giving /webapp/images in
the
> browser and then see if the file is in the file list
>
> Regards,
> Nagarajan.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of James
> Adams
> Sent: Friday, September 07, 2001 12:49 AM
> To: [EMAIL PROTECTED]
> Subject: Image file not found - why not ?
>
>
> I have a JSP which tries to load an image which is
> referenced by a URI which is set in the request by a servlet.
>
> <img src="<%= request.getAttribute("imageURL") %>"
>      alt="IMAGE NOT FOUND">
>
> Unfortunately this has never worked because Tomcat can never
> find the image.  Perhaps I am using a bad URI ?  I have the
> image located under my application's base directory in a
> subdirectory
> named "images".  The URIs I've tried are "images/MyImage.jpg",
> "./images/MyImage.jpg" and
> "/images/MyImage.jpg", all of which are not found when I
> view the page.
>
> Can anyone please tell me what I'm doing wrong ?  Thanks in
> advance for all suggestions, and email of the responses would be
> appreciated if possible ([EMAIL PROTECTED]).
>
>
> -James
>

Reply via email to