【发布时间】:2014-11-12 04:23:09
【问题描述】:
在我的 shiro 应用程序中,我想为除 REST 之外的所有路径定义一个 AuthenticationFilter。
ie /rest/... 不会通过它,但其他一切都会。
我使用的是Shiro-Guice,所以我的过滤器设置格式为
addFilterChain("/rest/**" ,restFilter)
addFilterChain("/**", filter) //I want this one to work on everything except my rest filter
我查看了 this question 关于 Ant 路径模式样式的信息,但似乎不支持正则表达式。
【问题讨论】:
-
即使使用默认
AntPathMatcher,您所要求的内容也可以开箱即用。 Shiro 对过滤器链以及链内的过滤器使用first match wins 策略。