1

何らかの理由で、vote() メソッドで期待していた authorityObject は 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>

どんな手掛かり?私は本当に少し助けを使うことができました!

4

1 に答える 1

-1

構成xmlに欠落している<aspectj:autoproxy/>タグを付ける必要がありました。これにより、Bean がセキュリティ インターセプターによって自動プロキシ化されます。

于 2009-07-29T03:31:42.610 に答える