2015-06-28 120 views
0

我有一个代码片段从春季3移植到4

<beans:bean id="accessDecisionManager" 
 
\t \t class="org.springframework.security.access.vote.AffirmativeBased"> 
 
\t \t <beans:property name="decisionVoters"> 
 
\t \t \t <beans:list> 
 
\t \t \t \t <beans:bean 
 
\t \t \t \t \t class="org.springframework.security.access.vote.AuthenticatedVoter" /> 
 
\t \t \t \t <beans:bean class="org.springframework.security.access.vote.RoleVoter" /> 
 
\t \t \t </beans:list> 
 
\t \t </beans:property> 
 
</beans:bean>

我要迁移这个春天4 根据http://docs.spring.io/spring-security/site/migrate/current/3-to-4/html5/migrate-3-to-4-xml.html#m3to4-deprecations-core-aadm

我知道,如果我有什么像这样:

<b:bean class="org.springframework.security.access.vote.UnanimousBased"> 
 
\t <b:property name="decisionVoters" ref="voters"/> 
 
</b:bean>

我必须做的:

<b:bean class="org.springframework.security.access.vote.UnanimousBased"> 
 
\t <b:constructor-arg ref="voters"/> 
 
</b:bean>

但我不知道该怎么做我的情况..请帮助

我还希望如果你能指出财产名称的意义,谢谢。

回答

0

对不起,我很愚蠢。这似乎工作完美。

<beans:bean id="accessDecisionManager" 
     class="org.springframework.security.access.vote.AffirmativeBased"> 
     <beans:constructor-arg> 
      <beans:list> 
       <beans:bean 
        class="org.springframework.security.access.vote.AuthenticatedVoter" /> 
       <beans:bean class="org.springframework.security.access.vote.RoleVoter" /> 
      </beans:list> 
     </beans:constructor-arg> 
    </beans:bean>