tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Servlet Mappings
Date Mon, 30 Oct 2006 14:25:24 GMT
Ben,

> With this setup requests that start with /error go to the testerror
> servlet, all other requests go to the test servlet.

Just a guess, but I would try putting this catch-all servlet mapping:

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

at the end of the mappings. Or at the beginning if that doesn't work.
I'm guessing that Tomcat keeps these mappings as a list and iterates
over them looking for a match. Maybe the first match wins?

If you think about this like a switch statement, your catch-all case
should be at the bottom of the list.

-chris


Mime
View raw message