Web.xml <filter-mapping> does not work when using <servlet-name>

I have web.xml that has this in it:

 <filter>
    <description>CASRebroadcastFilter</description>
    <filter-name>CASRebroadcastFilter</filter-name>
    <filter-class>edu.utah.acs.tek.filters.CASSingleSignOutRebroadcast</filter-class>
</filter>

(... more CAS-filters)

<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>

<filter-mapping>
    <filter-name>CASRebroadcastFilter</filter-name>
    <url-pattern>*.do</url-pattern>        
</filter-mapping>

(... more CAS-filter-mappings and the rest of my web.xml...)

Environment: Spring 2.5, Glassfish 2.1

And it works as expected, namely: CASRebroadcastFilter intercepts and processes the corresponding calls and allows you to skip everything else.

But if I changed my filter mapping to this:

<filter-mapping>
    <filter-name>CASRebroadcastFilter</filter-name>
    <servlet-name>dispatcher</servlet-name>
</filter-mapping>

This does not work. And "does not work," I mean exactly this: everything goes through the CASRebroadcastFilter, as if it simply does not exist, and not a single error or other thing is output.

As if the tag <servlet-name>just didn't work in the context of any aspect of my environment.

Has anyone else seen this or knew what could be causing this?

+3
source share
1

, , . , web.xml, url-, . , , url-, -.

, -, , url-.

+1

All Articles