现象:需要在filter标签后添加多个filter-mapping标签,一个url-pattern就对应一个filter-mapping标签,不能直接把多个url-pattern配置到同一个filter-mapping标签里,也不能直接把多个url直接配置到一个url-pattern标签里。正确地配置方式如下所示:

    1. <filter>
    2. <filter-name>test</filter-name>
    3. <filter-class>com.test.TestFilter</filter-class>
    4. </filter>
    5. <filter-mapping>
    6. <filter-name>test</filter-name>
    7. <url-pattern>/test/a/*</url-pattern>
    8. </filter-mapping>
    9. <filter-mapping>
    10. <filter-name>test</filter-name>
    11. <url-pattern>/test/b/*</url-pattern>
    12. </filter-mapping>