<filter-mapping>
<filter-name>BackgroundLogin</filter-name>
<url-pattern>/background/*</url-pattern>
</filter-mapping>
我配置的这个过滤器,怎么只过滤
http://localhost:8080/demo/background/*.action下面的地址都没有过滤呢。
http://localhost:8080/demo/background/manager/*.action
http://localhost:8080/demo/background/webconif/*.action
<filter-name>BackgroundLogin</filter-name>
<url-pattern>/background/*</url-pattern>
</filter-mapping>
我配置的这个过滤器,怎么只过滤
http://localhost:8080/demo/background/*.action下面的地址都没有过滤呢。
http://localhost:8080/demo/background/manager/*.action
http://localhost:8080/demo/background/webconif/*.action
引用 1 楼 gaulhor 的回复:
高手帮帮忙呀 怎么没人理我呀
我也需要帮忙
[/Quote]回复测试。
<url-pattern>/background/*</url-pattern>
这个地址拦截的是 background/*(后面任意)
http://localhost:8080/demo/background/*.action
http://localhost:8080/demo/background/manager/*.action
http://localhost:8080/demo/background/webconif/*.action这三个都应该过滤呀
<filter-mapping>
<filter-name>BackgroundLogin</filter-name>
<url-pattern>/background/manager/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>BackgroundLogin</filter-name>
<url-pattern>/background/webconif/*</url-pattern>
</filter-mapping>
LZ把 url-pattern中的.action去掉看看
*通配就代表任何字符串, 包括/
请求被过滤链中的其它过滤器先行拦截了