gpt4 book ai didi

java - web.xml 过滤器如何工作?您可以将两个过滤器映射到所有页面(/*)并指定顺序吗?

转载 作者:IT老高 更新时间:2023-10-28 20:27:45 28 4
gpt4 key购买 nike

我想使用 Spring Security,它说将过滤器映射到/***。但是我已经有一个映射到/* 的过滤器,它是 Tuckee URLRewrite 过滤器。

是否可以将两个过滤器映射到同一个事物,还有没有办法指定过滤器被调用的顺序?

最佳答案

是的,您可以:

The servlet 2.5 xsd :

The order in which filters are invoked is the order in which filter-mapping declarations that match a request URI for a servlet appear in the list of filter-mapping elements

即这取决于您的 <filter-mapping> 的顺序web.xml 中的元素

关于java - web.xml 过滤器如何工作?您可以将两个过滤器映射到所有页面(/*)并指定顺序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2122455/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com