tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghupathy,Gurumoorthy" <>
Subject RE: url-pattern in web.xml -- looking for explanations and best p ractice
Date Wed, 11 May 2005 14:29:34 GMT
In your webapp have dir 
	http://servername:port/context/static/ for all your static content

	http://servername:port/context/dynamic/ for all your dynamic content

	URL Pattern

-----Original Message-----
From: Tim Diggins [] 
Sent: 11 May 2005 15:26
Subject: url-pattern in web.xml -- looking for explanations and best


I'm trying to configure my tomcat 5.0.28 webapp so that one servlet (a 
Spring dispatcher as it happens, but that's irrelevant) receives 
virtually everything except standard static non-text file patterns 
(*.css, *.png, *.gif, etc.) which I want served up statically.

I've been trying various options for url-pattern within servlet mapping 
and have been getting very confused... Some questions therefore...

1) Is there a definition / documentation of what the syntax for a 
url-pattern is?  I've tried and tried googling and looking, but can't 
find such a thing (I'm not sure that it's standardised across different 
containers, but there seems to be no definition in the tomcat docs that 
I could find). Obviously, if anyone can refer me to this, then I don't 
need the other questions answered!

2) is there any way to say - if a url includes a ~ (tilde character) 
then route it to a particular servlet. The following give errors:

But oddly the following doesn't:

*error looks like:
11-May-2005 15:13:07 org.apache.catalina.startup.ContextConfig 
SEVERE: Parse error in application web.xml 
java.lang.IllegalArgumentException: Invalid <url-pattern> ~/*.* in 
servlet mapping

3) is there any way to specify NO extension (like a request for 
directory) and exclude things with an extension?

4) is there any way to specify what you want to go to the default 
(static) servlet and then state a sink for anything else (invert the 
default-specific servlet mapping in other words).

5) is there some obvious best practice I'm missing here (excluding 
making my urls less interpretable).

Many thanks


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

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

View raw message