我正在尝试为jboss设置spring安全命名空间,但每次尝试启动服务器时,都会收到错误
安全命名空间不支持元素的装饰 [过滤器链]
以下是代码:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
<security:global-method-security secured-annotations="enabled"/>
<bean xml:id="customSecurityFilter" class="org.springframework.security.web.FilterChainProxy">
<security:filter-chain pattern="/login.jsp*" filters="none"/>
<security:filter-chain pattern="/MaintenanceLogin.jsp*" filters="none"/>
<security:filter-chain pattern="/PortalLogin.jsp*" filters="none"/>
</bean>
<security:http>
<security:custom-filter ref="customSecurityFilter" before="FIRST"/>
<!-- Override default login and logout pages -->
<security:form-login login-page="/login.jsp"
default-target-url="/DisplayAlerts.action"
authentication-failure-url="/login.jsp?login_error=1" />
<security:logout logout-url="/j_spring_security_logout" logout-success-url="/login.jsp" />
</security:http>
请帮忙
答案 0 :(得分:0)
如果您想使用过滤器链,可以将其包装在地图中
<bean xml:id="customSecurityFilter" class="org.springframework.security.web.FilterChainProxy">
<security:filter-chain-map path-type="regex">
<security:filter-chain pattern="/login.jsp*" filters="none"/>
<security:filter-chain pattern="/MaintenanceLogin.jsp*" filters="none"/>
<security:filter-chain pattern="/PortalLogin.jsp*" filters="none"/>
</security:filter-chain-map path-type="regex">
</bean>
您可以参考文档here