tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Filter Mapping URL Pattern
Date Fri, 18 Sep 2015 19:57:11 GMT
> From: George Sexton [mailto:georges@mhsoftware.com] 
> Subject: Filter Mapping URL Pattern

> I'm trying to add a filter mapping with the URL-Pattern
> <url-pattern>/*.css</url-pattern>

Which, unfortunately, isn't allowed.  You probably just need to remove the leading slash.

> Can someone direct me to a a BNF definition of what's an acceptable 
> url-pattern in the specification, or some portion of the servlet spec 
> that explains the implementation of StandardContext.validateURLPattern()?

See section 12.2 of the servlet spec (not quite BNF, but probably good enough):

In the Web application deployment descriptor, the following syntax is used to define
mappings:
■ A string beginning with a '/' character and ending with a '/*' suffix is used for
path mapping.
■ A string beginning with a '*.' prefix is used as an extension mapping.
■ The empty string ("") is a special URL pattern that exactly maps to the
application's context root, i.e., requests of the form http://host:port/<contextroot>/.
In this case the path info is '/' and the servlet path and context path is
empty string ("").
■ A string containing only the '/' character indicates the "default" servlet of the
application. In this case the servlet path is the request URI minus the context path
and the path info is null.
■ All other strings are used for exact matches only.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


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


Mime
View raw message