tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john-paul delaney>
Subject RE: NewB/Default Servlet:Can't find .gif
Date Mon, 18 Feb 2002 19:34:36 GMT

Thanks Justin...

excerpt from web.xml>>>


intro.class is in $CATALINA_HOME/webapps/
test.gif in in $CATALINA_HOME/webapps/>>>

import javax.servlet.*;
import javax.servlet.http.*;

public class intro extends HttpServlet {

   public void doGet( HttpServletRequest req, HttpServletResponse res )
       throws ServletException, IOException {

       PrintWriter out = res.getWriter();

       out.println( "<html><head><title>justatest</title></head>"

       out.println("<img src=\"/test.gif\" width=\"146\" height=\"125\" alt=\"TEST\">");

       out.println( "<body><h1>Justatest...!</h1></body></html>"

Here I realise I may have misled you: 
This page renders ok if I explicitly point to url 
It fails if I change the url-pattern within the servlet-mapping to "/" (and access it with
the url - the test.gif is no longer found by the server.

Any suggestions? Rgds/j-p.

On Mon, 18 Feb 2002, Justin Rowles wrote:

> > I'm confused as to why once I change the servlet-mapping from 
> > "/" to "/intro" that the .gif is read.
> So am I ;-)
> Can you print out the output from either case and send it.
> J.


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message