开发者社区> 问答> 正文

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 768 0
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
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多