在使用表单进行提交的时候,一直报不支持POST方法的错误。
我在springmvc中的代码
@PostMapping("reg.do") public String register(@Valid User user,Errors errors,Model m) { //业务代码省略 }
在reg.html中的代码
<form id="regform" method="post"> 账号:<input name="account" th:value="${user}!=null ? ${user.account} : ''"> <span class="err" th:if="${errors}!=null" th:text="${errors.get('account')}"></span><br> 昵称:<input name="name" th:value="${user}!=null ? ${user.name} : ''"> <span class="err" th:if="${errors}!=null" th:text="${errors.get('name')}"></span><br> 密码:<input name="pwd" type="password" th:value="${user}!=null ? ${user.pwd} : ''"> <span class="err" th:if="${errors}!=null" th:text="${errors.get('pwd')}"></span><br> 邮箱:<input name="email" th:value="${user}!=null ? ${user.email} : ''"> <span class="err" th:if="