tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <>
Subject [OT] wildcard servlet mapping also catching jsps
Date Thu, 30 Jun 2005 15:48:15 GMT
Hi Guys,

Having a real ball ache with a requirement. We want to handle any URL with a Spring controller
(servlet for those not into Spring).



We want coming to our controller. Why? Because we have fancy page lookup and redirect services
that the servlet should use to send out the resultant JSP or redirect.

We run IIS -> JK -> Tomcat. To achieve getting arbitrary URLs into our controller we

1. Mapping in JK's conf, i.e /*=ajp13 to route everything to the ajp13 tomcat worker.
2. Mapping in application web.xml for the controller servlet with mapping /* (everything!)
3. The Spring controller too needs a mapping itself /* but that's not really important I think.

So we make one of those requests. And sure enough it gets to our controller servlet. We're
happy. Until what happens next. The controller, sends back a JSP view, probably via request
forwarding or whatever. However, the web.xml /* mapping to the controller picks up the JSP
request/forward whatever, and so the JSP is never run as we're in a loop.

Why oh why can't servlet-mapping elements allow for exclusions I don't know. Perhaps someone
out there has an amazing idea that will ease the pain here :)

Looking forward to solutions if indeed there are any. 

All the best, Allistair

PS: I tried an ugly hack by adding the Tomcat JSP Servlet to my application web.xml and mapping
*.jsp to it - did not work.

QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message