The rules in the Servlet spec (section 11.1) state that prefix mapping take
precedence over extension mappings. This means that you have two choices:
1) <servlet-mapping>
<servlet-name>my</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
which calls "my" when no other pattern matches (including static content).
2) Include code in your servlet like:
if(request.getPathInfo().endsWith(".jsp")) {
RequestDispacher rd = application.getNamedDispatcher("jsp");
rd.forward(request, response);
return;
}
The second option isn't portable to other Servlet containers.
"Thomas Heller" <[EMAIL PROTECTED]> wrote in message
news:001101c27690$36e91b90$0000fea9@;comtron.net...
> hi there,
>
> im trying to find a standard catalina/tomcat setup so that every *.jsp is
> handled by the jasper jsp servlet and "/*" on my servlet context path is
> handled by my servlet. as soon as i put
>
> <servlet-mapping>
> <servlet-name>jsp</servlet-name>
> <url-pattern>*.jsp</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>my</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> into my web.xml _every_ request is mapped to my servlet. i'm using
> requestdispatcher.forward after my servlet processed the request and
forward
> to a jsp page. but .. as /* matches the jsp file the request gets into my
> servlet again. causing a stack overflow after some time.
>
> well i could write my own Wrapper and tell tomcat in the server.xml to use
> it instead of StandardContextMapper but i wonder if there isnt a more
> "correct" way cause i dont think that other servlet containers will allow
me
> to add a custom mapper?
>
> thanks,
> thomas
--
To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>