|
@@ -1,3 +1,4 @@
|
|
|
|
+<%@ page import="org.springframework.security.web.csrf.CsrfToken" %>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
|
|
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
|
|
|
|
|
|
@@ -27,6 +28,11 @@ by the application and will be recognized if you return.
|
|
<p>
|
|
<p>
|
|
Your principal object is....: <%= request.getUserPrincipal() %>
|
|
Your principal object is....: <%= request.getUserPrincipal() %>
|
|
</p>
|
|
</p>
|
|
-<p><a href="logout">Logout</a>
|
|
|
|
|
|
+<% CsrfToken token = (CsrfToken) request.getAttribute(CsrfToken.class.getName()); %>
|
|
|
|
+<form id="logout" method="post" action="logout">
|
|
|
|
+ <input type="hidden" name="<%= token.getParameterName() %>"
|
|
|
|
+ value="<%= token.getToken() %>"/>
|
|
|
|
+</form>
|
|
|
|
+<p><a href="#" onclick="document.forms[0].submit()">Logout</a></p>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|