tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand HS <anan...@gmail.com>
Subject A question about excluding URL patterns from filters
Date Fri, 06 Feb 2009 05:24:29 GMT
Hi, I have a filter that takes all requests that try to hit http and
redirects them through https.
Here is the web.xml configuration for that. -

<filter>
<filter-name>SecuredChannelFilter</filter-name>
<filter-class>com.psi.servlet.filter.SecuredChannelFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>SecuredChannelFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>

Now, I have a requirement to exclude only *.xsl from this filter.
What would be the best way to make this exclusion. ?
Currently, I can think of 2 ways -

1. Change the filter code to check the url pattern and exclude only url
patterns that request for xsl resources.
2. Create another filter that does nothing but forward the request and the
url pattern for that filter would be only *.xsl. I need to however, make
sure this filter does not call the SecuredChannelFilter

However, I believe there must be a more 'elegant' way to exclude a url
pattern through configuration than adding/modifying more code. :)
Could you shed more ideas on this. ?

Thanks,
Anand

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message