Request method 'POST' not 405状态码
在写SpringBoot,首先,我的思路是这样的,我的路径/system/taRole/taRoleAdd一个是get和Post方式,打开添加页面时使用get方式(使用注解@GetMapping),添加保存数据使用post(@PostMapping)
发现错误异常
2019-12-27 16:51:19.579 WARN 8816 --- [io-8882-exec-24] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]
``
解决总结
**1.@PostMapping post请求如找不到路径则回报405状态码错误异常
2.@GetMapping get请求如找不到路径则会报404状态码错误异常
**
仔细检查页面返回的路径和控制器的路径是否一致相似
还没有评论,来说两句吧...