You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Adams <ja...@ucar.edu> on 2001/09/07 19:28:08 UTC
Re: Rep: Image Not Found
Vijaya you win the prize, having ".." in front of the URL made all the
difference. Thanks so much !
-James
> Vijaya Kumar wrote:
>
> 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: jadams@acd.ucar.edu [mailto:jadams@acd.ucar.edu]On Behalf Of
> James
> > Adams
> > Sent: Friday, September 07, 2001 12:49 AM
> > To: tomcat-user@jakarta.apache.org
> > 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 (jadams@ucar.edu).
> >
> >
> > -James
> >