由于某种原因,我在 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>
和委托MethodDefinitionSource,像这样:
<b:bean id="_delegatingMethodDefinitionSource" class="org.springframework.security.intercept.method.DelegatingMethodDefinitionSource">
...
</bean>
有什么线索吗?我真的需要一点帮助!