Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring security 如何使用spring security注销?_Spring Security - Fatal编程技术网

Spring security 如何使用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

我在我的struts2应用程序上应用了Spring security,它可以完美地工作,但是当我在下面这样的地址中并单击注销时,它会遇到以下错误

 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>