相关疑难解决方法(0)

调用j_spring_security_logout不起作用

我正在尝试使用j_spring_security_logout设置我的应用程序的logut但由于某种原因它无法正常工作,我一直收到404错误.

我正在调用这样的函数:

<a href="<c:url value="/j_spring_security_logout"/>"><img border="0" id="logout" src="./img/logout.png" /></a>

我在WebContent/jsp/my应用程序主页面中,登录和注销页面在WebContent/login /中.

我还检查了Spring安全注销的其他帖子问题但是那里给出的解决方案对我不起作用.

在这里你可以看到我的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>
Run Code Online (Sandbox Code Playgroud)

这是我的spring-security.xml

<http auto-config="true">
    <intercept-url pattern="/*" access="ROLE_USER" />
    <form-login login-page="/login/login.jsp" 
                authentication-failure-url="/login/errorLogin.jsp"/>
    <logout logout-success-url="/" logout-url="/login/logout.jsp" />
</http>

<beans:bean id="myAuthenticationProvider" 
    class="myapp.web.authentication.WSAuthenticationProvider">
</beans:bean>

<authentication-manager>
    <authentication-provider ref="myAuthenticationProvider"/>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)

提前致谢.

security spring logout

20
推荐指数
3
解决办法
4万
查看次数

标签 统计

logout ×1

security ×1

spring ×1