问题描述
thymeleaf是一种前端模板,类似与freemaker,但是其文件格式是html格式,可以配合Spring boot一起使用,在使用Spring boot + Spring Security + thymeleaf整合时,默认情况下,使用Spring Security 时form表单如果不使用th:action标签,会出现无法提交的问题
问题解决
在Spring Security的配置中,加入配置:
@Override
protected void configure(HttpSecurity http)
throws Exception {
http.csrf().disable();
}
配置后form 使用普通的action也可正常提交