Spring security 如何使用spring security注销?
我在我的struts2应用程序上应用了Spring security,它可以完美地工作,但是当我在下面这样的地址中并单击注销时,它会遇到以下错误Spring security 如何使用spring security注销?,spring-security,Spring Security,我在我的struts2应用程序上应用了Spring security,它可以完美地工作,但是当我在下面这样的地址中并单击注销时,它会遇到以下错误 localhost/myProject/cons 错误 java.lang.NoSuchMethodException: com.myProject.controller.cons.j_spring_security_logout() 我只能在应用程序的第一页(索引页)中成功注销。 我想问题在于我的登录链接,但不确定如何解决这个问题 securi
localhost/myProject/cons
错误
java.lang.NoSuchMethodException: com.myProject.controller.cons.j_spring_security_logout()
我只能在应用程序的第一页(索引页)中成功注销。
我想问题在于我的登录链接,但不确定如何解决这个问题
security.xml
<logout logout-success-url="/index.jsp"/>
注销链接
<a href="<c:url value="j_spring_security_logout" />" > Logout</a>
使用
我也面临这个问题。我忘了把这个添加到我的页面顶部
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
这就是页面开头的样子
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
您也可以推广我的答案:)
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>