【发布时间】:2010-11-14 12:27:06
【问题描述】:
由于某种原因,我在 vote() 方法中所期望的 authoritieObject 是 FilterInvocation 的一个实例,我需要一个 MethodInvocation。无法弄清楚为什么会这样。
我的 web.xml 如下:
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
我的应用上下文:
<b:bean id="_methodDefinitionSourceAdvisor" class="org.springframework.security.intercept.method.aopalliance.MethodDefinitionSourceAdvisor">
<b:constructor-arg value="_methodSecurityInterceptor" />
<b:constructor-arg ref="_delegatingMethodDefinitionSource" />
</b:bean>
MethodSecurityInterceptor 的定义如下:
<b:bean id="_methodSecurityInterceptor" class="org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor">
...
</b:bean>
和delegatingMethodDefinitionSource,像这样:
<b:bean id="_delegatingMethodDefinitionSource" class="org.springframework.security.intercept.method.DelegatingMethodDefinitionSource">
...
</bean>
有什么线索吗?我真的需要一点帮助!
【问题讨论】:
-
其实我才发现发生了什么。有人从我们的一个 xml 配置文件中删除了 aspectj:autoproxy 标签。因此,spring 没有正确实例化我们的 bean,将拦截器保留为默认的:FilterInterceptor。无论如何,感谢您提供帮助...我会尽快在此处发布答案。
标签: spring-security