Actually, isn't "/" the default servlet ? "/*" would be "every request", but just a single slash is 'when you don't recognize a request, try this servlet'. Do you think <img src="images/foo.gif"> would work? (no leading / on the image path)
> -----Original Message----- > From: Tim Funk [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 6:10 AM > To: Tomcat Users List > Subject: Re: Setting the root application > > > That is because / matches EVERY request so you have replaced > the default > servlet. Your servelt is now responsible for serving images. > > An easy workaround is to: > - use welcome file listing in web.xml > - create a welcome file (ex: index.jsp) that redirects to > your servlet mapped > to a better mapping > > -Tim > > Duncan Strang wrote: > > Hi > > > > I hope you don't consider this too trivial a question but I > have tried > > everything I can think of to get this working. I have read > as much of > > the docs as I can, looked at the faq's and searched the archives. I > > know the information is there but I can't find it. > > > > I want to make my application the root application. > > That is, I don't want to have to type in the context path after the > > port I just want to type http://localhost:8080 > > > > Actually I have this working. > > The first resource accessed is a Servlet > > here's my servlet mapping > > > > <servlet-mapping> > > <servlet-name>LocaleChecker</servlet-name> > > <url-pattern>/</url-pattern> > > </servlet-mapping> > > > > When I access http://localhost:8080 <http://localhost:8080/> the > > servlet executes and forwards the request to a jsp dependant on > > weather a cookie is available here is the server.xml that sets the > > root application > > > > <Context path="" docBase="mydir" debug="0"/> > > > > here is the jsp that is being executed > > > > ... > > > > <%System.out.println("JSP resource paths = " + > > application.getResourcePaths("")); %> > > > > <br><br> > > <table> > > <tr> > > <td><img src="/images/england.gif"></td> > > </tr> > > </table> > > > > ... > > > > The output from getResourcePaths is > > > > JSP resource paths = [/header.jsp, /images/, /.nbattrs, > > /getCountry.jsp, /WEB-INF/] Yes, the images are available in the > > images directory. > > > > However, no matter what I do I cannot get the images to display. I > > have tried every conceivable path expression without luck. > > > > Any halp much appreciated. > > > > Cheers > > Duncan L.Srang > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
