防止跨站请求伪造(CSRF)
<form method="POST" th:action="@{/spittles}"> ... </form><input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
@Override
protected void configure(HttpSecurity http) throws Exception {
http
...
.csrf()
.disable();
}Last updated