在请求参数'_csrf'或标头'X-CSRF-TOKEN'上发现无效的CSRF令牌'null'
配置Spring Security 3.2之后,_csrf.token未绑定到请求或会话对象。 这是spring安全配置: <http pattern="/login.jsp" security="none"/> <http> <intercept-url pattern="/**" access="ROLE_USER"/> <form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?error=1" default-target-url="/index.jsp"/> <logout/> <csrf /> </http> <authentication-manager> <authentication-provider> <user-service> <user name="test" password="test" authorities="ROLE_USER/> </user-service> </authentication-provider> </authentication-manager> login.jsp文件 <form name="f" action="${contextPath}/j_spring_security_check" method="post" > <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /> <button id="ingresarButton" name="submit" type="submit" class="right" style="margin-right: 10px;">Ingresar</button> <span> <label for="usuario">Usuario …