tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <...@benshort.co.uk>
Subject Re: Tomcat 5.5 Regular Expression as servlet-mapping url-pattern
Date Fri, 27 Oct 2006 18:53:59 GMT
I am part of a team that is replacing a cocoon application with spring
mvc. We have to keep the URL format for the application the same as
the current system.

The URLs are http://www.site.com/customername. We are currently
mapping everything to one DispatcherServlet. The problem is static
content like images at the url http://www.site.com/images get mapped
to the DispatcherServlet also rather than the images directory in the
root of the webapp.

We could add in a servlet mapping for each of the customernames but
this would become configuration hell.

So I wanted to do something like map requests that are not equal to
images, css, js etc to the DispatcherServlet.

Has anyone any ideas if this is possible?

The current solution uses apache URL rewriting and only forwards
requests for non static to tomcat. I just wanted to be able to deploy
everything in one place.

Ben



On 10/27/06, Rick Fisk <Rick.Fisk@authoria.com> wrote:
> Have you tried using getServletContext()?
> (http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletC
> ontext.html)
>
>
> We use this as a means to find and match our properties (stored in a
> common property container directory by context) since we deploy multiple
> instances of the same app for different customers. This allows us to
> deploy for a new customer merely by adding a properties directory for
> the customer and re-naming the war file to match this. At startup, we
> ask for our context, look up our properties and then assume that all url
> mapping will direct to /<CONTEXT>/
>
> Is this even relevant to your question? :-)
>
> -----Original Message-----
> From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
> ben short
> Sent: Friday, October 27, 2006 8:35 AM
> To: Tomcat Users List
> Subject: Tomcat 5.5 Regular Expression as servlet-mapping url-pattern
>
> Hi is it possible to use a regular expression as a servlet-mappings
> url-pattern?
>
> Ben
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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