> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Subject: Re: Servlet Mappings
> 
>    <servlet-mapping>
>        <servlet-name>default</servlet-name>
>        <url-pattern>/images/*</url-pattern>
>    </servlet-mapping>

Thanks for the example.  With that, turning on debugging, and looking at
the code in DefaultServlet.java, I finally figured out what's going on.
Turns out the standard DefaultServlet is designed to execute only with a
path mapping of "/".  It can also use extension mappings, but only those
without any prefix - which is why your *.jpg mapping worked.

The standard DefaultServlet uses HttpServletRequest.getPathInfo(), which
is defined to return only extra path information - that which is beyond
the mapping that selected the servlet.  So, with the "/images/*" pattern
and a URL of /test/images/test.jpg, the DefaultServlet went looking for
"/test.jpg", and returned the 404 when it couldn't be found.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to