tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <...@benshort.co.uk>
Subject Re: Servlet Mappings
Date Mon, 30 Oct 2006 15:01:55 GMT
Hi,

I changed the mapping to as follows but no joy. Although the problem
seems to of changed slightly. When I try to request an images
http://myhost/images/error/logo.gif i get a 404. I have double checked
and the image is definatly in the correct location.

<servlet-mapping>
        <servlet-name>testerror</servlet-name>
        <url-pattern>/error/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

On 10/30/06, Caldarale, Charles R <Chuck.Caldarale@unisys.com> wrote:
> > From: jamin.short@gmail.com [mailto:jamin.short@gmail.com]
> > Subject: Servlet Mappings
> >
> >     <servlet-mapping>
> >         <servlet-name>testerror</servlet-name>
> >         <url-pattern>/error/*</url-pattern>
> >     </servlet-mapping>
>
> The above is correct; note the trailing "/*".
>
> >      <servlet-mapping>
> >         <servlet-name>test</servlet-name>
> >         <url-pattern>/</url-pattern>
> >     </servlet-mapping>
>
> This one says to send everything that doesn't match something else to
> the "test" servlet.
>
> >     <servlet-mapping>
> >       <servlet-name>default</servlet-name>
> >       <url-pattern>/images</url-pattern>
> >     </servlet-mapping>
>
> This one is missing the trailing "/*".
>
> >     <servlet-mapping>
> >       <servlet-name>default</servlet-name>
> >       <url-pattern>/css</url-pattern>
> >     </servlet-mapping>
>
> Is this intended to send only items from the css directory to the
> default servlet?  If so, then you're missing the trailing "/*".  If you
> want to send all .css files to the default, use "*.css", with no
> slashes.
>
> >     <servlet-mapping>
> >       <servlet-name>default</servlet-name>
> >       <url-pattern>/js</url-pattern>
> >     </servlet-mapping>
>
> Similar to the css one: you need a trailing "/*" or it should be
> "*.js*".
>
> Order of servlet mappings is not important - the spec requires that the
> container honor the longest match first.
>
>  - 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: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Mime
View raw message