开发者社区 问答 正文

spring security3替换默认过滤器,报错,求助?报错

 


public class AuthorizationSecurityInterceptor extends AbstractSecurityInterceptor implements Filter

<beans:bean id="securityInterceptor" class="com.demo.subsystem.authentication.service.impl.AuthorizationSecurityInterceptor">
<beans:property name="accessDecisionManager" ref="authorizationAccessDecisionManager" />
<beans:property name="authenticationManager" ref="authenticationManager" />
<beans:property name="securityMetadataSource" ref="authorizationSecurityMetadataSource" />
</beans:bean>

<http use-expressions="true" access-denied-page="/denied" entry-point-ref="authenticationProcessingFilterEntryPoint">
<logout invalidate-session="true" logout-success-url="/login" logout-url="/logout" delete-cookies="JSESSIONID"/>
<custom-filter ref="loginAuthenticationFilter" before="FORM_LOGIN_FILTER"/>
<custom-filter ref="securityInterceptor" position="FILTER_SECURITY_INTERCEPTOR" />
 
<session-management invalid-session-url="/timeout">
<concurrency-control session-registry-ref="sessionRegistry" max-sessions="1" error-if-maximum-exceeded="false" expired-url="/timeout"/>
</session-management>
</http>


我要替换FILTER_SECURITY_INTERCEPTOR拦截器


启动时报错Configuration problem: Filter beans '<authorizationSecurityInterceptor>' and '<org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0>' have the same 'order' value. When using custom filters, please make sure the positions do not conflict with default filters. Alternatively you can disable the default filters by removing the corresponding child elements from <http> and avoiding the use of <http auto-config='true'>.

展开
收起
爱吃鱼的程序员 2020-06-14 19:56:05 803 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    好像只能在<spanstyle="font-family:Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">FILTER_SECURITY_INTERCEPTOR的before,确实要替换的话,就不能用http标签,而是写一大堆bean3q,我试验了几次,确实是这样

    2020-06-14 19:56:22
    赞同 展开评论