Is it possible to use wildcards within J2EE - fitlers?

Posted by Sergio del Amo on Stack Overflow See other posts from Stack Overflow or by Sergio del Amo
Published on 2009-06-03T16:16:48Z Indexed on 2010/04/27 21:53 UTC
Read the original article Hit count: 239

Filed under:
|

I would like to apply a filter to severl url endings. The next configuraiton seems to work.

<filter>
    <filter-name>LanguageFilter</filter-name>
    <filter-class>filters.LanguageFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>LanguageFilter</filter-name>
    <url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>LanguageFilter</filter-name>
    <url-pattern>*.xml</url-pattern>
</filter-mapping>

Originally I asked if it was possible to use wildcards such as:

    <url-pattern>*.do|*.xml</url-pattern>

But it does not seem to be possible.

© Stack Overflow or respective owner

Related posts about servlet-filter

Related posts about tomcat