tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
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).

Therefore

http://ourserver/wacky/url
http://ourserver/something

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
have

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.



<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message