在项目中使用restful风格put提交时报错,是由于form表单中的th:href引起的(支持post提交),改为th:action即可
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201214210737516.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201214210700802.png)
顺便记一下put请求的使用
1.在使用thymeleaf模板引擎下,form表单应该为post请求,get请求不行,在form表单之间引入方法名为_method,value值为put的input标签
2.写一个put请求方法,直接在对应方法上方加注解@PutMapping("/emp")即可或者使用注解
@ResponseBody
@RequestMapping(value = “/emp”,method = RequestMethod.PUT)