It looks like you access the jsp through an url 
like /myapp/servlet/some.jsp.

If you call it like that, you tell the browser
with src="image1.gif" to look for image1.gif
in the same directory as the requested page.
As the browser isn't aware of the internal 
directory structure of the server he has only the
url to work on. So he requests /myapp/servlet/image1.gif
which tomcat tries to map to a servlet that
doesn't exist.

I recommend to use absolute pathnames for the
images. (As I'm not using tomcat or any other
jsp engine that is above servlet spec 2.0), 
I'm not shure wether this is a good advice
in this environment)

> -----Ursprüngliche Nachricht-----
> Von: Mark [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 27. November 2001 14:58
> An: [EMAIL PROTECTED]
> Betreff: .gif images not displaying with JSPs
> 
> 
> My servlet/JSP/JavaBean app is working under TC 4.0.1, except 
> for images
> not displaying in JSPs. The various .gifs live in the root 
> context for the
> application, ie. the same directory as the html and JSP 
> files.  The JSP has
> simple embedded html statements such as:
> 
>     <a><img src="image1.gif" align="left"></a>
> 
> For each img tag, the application log has an associated set of errors:
> 
>    2001-11-27 08:24:34
> StandardWrapper[/myapp:org.apache.catalina.INVOKER.image1.gif]:    
>    Marking servlet org.apache.catalina.INVOKER.image1.gif as 
> unavailable
>    2001-11-27 08:24:34 invoker: Cannot allocate servlet 
> instance for path   
>    /myapp/servlet/image1.gif
>    javax.servlet.ServletException: Wrapper cannot find servlet class
> image1.gif or a
>    class it depends on
>    ...
> 
>    - Root Cause -----
>    java.lang.ClassNotFoundException: image1.gif
> 
> The generated Java code (in ../work directory) looks like the 
> following:
> 
>     out.write("      \r\n\r\n<a><img src=\"image1.gif\"
> align=\"left\"></a>\r\n<a>
>               <img src=\"image2.gif\" align=\"left\"></a>\r\n");
> 
> 
> The page displays except for the images, and the resulting 
> html pushed to
> the browser has the <img> tags. The JSPs work under other 
> environments (eg.
> VAJ, Sun SDK, etc). What am I doing wrong this time under Tomcat?  
> 
> Thanks
> Mark
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 
> 
> 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to