----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

If you use a relative path, the browser (not the server) is going to construct the url 
based on the url of the page the graphic is contained in.  So if your page is found at 
/servlets/ServletName, and your page references "images/im1.gif", then the browser is 
going to look in /servlets/images for im1.gif.

Presumably, you want to look in "/images" not in "/servlets/images".  You can get this 
with an absolute reference ("/images/small-logo.gif") without having to be as 
hard-coded as having the server name included as well.

This *is* a moderately dumb question, but hey, we all have our off days.

Enjoy,
-Dan


kevin carothers wrote:
> 
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
> 
> Sorry for interrupting everyones y2k-alicious new year, but
> I can't figure this out:
> 
> I have a servlet that feeds HTML to a browser, and the HTML
> works fine when I send it to the browser (as a .html file.)
> But when I generate the HTML from the servlet, I can't get
> any of the images to display.  I get the message:
> 
>         [29/12/1999 21:44:47:586] (ERROR) ajp11: Servlet Error:
>                 ClassNotFoundException: images
> 
> in the mod_jserv.log for every graphic thingy on my pages.
> 
> I also get:
>         127.0.0.1 - - [29/Dec/1999:13:43:52 -0800] "GET
>                 /servlets/images/button5t.gif HTTP/1.0" 404 287
> 
> in the access.log for every thingy.
> Nothing has changed much from the "default" configuration of the server.
> Ie;  the servlet directory is "c:\Apache\servlets".
> I created a subdirectory of all my images called "images/" and put all
> my .gif crap there.
> 
> I looked at the obvious things and couldn't find anything.
> 
> I found a hint:
> absolute pathnames seem to work, like
>    <img height="64" width="80" src="http://localhost/images/small-logo.gif">
> 
> but relative path names, like:
>    <img height="64" width="80" src="images/small-logo.gif">
> 
> will always fail.
> Thanks for any help.
> 
> I'm running Apache/1.3.9 (Win32) ApacheJServ/1.0
> 
> Kevin Carothers
> 
> [EMAIL PROTECTED]
> 
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]

-- 

Dan Milstein // [EMAIL PROTECTED]
Member of Technical Staff // Capital Knowledge Partners


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to