本文主要是介绍PostMapping,GetMapping访问多个路径,报错500解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
PostMapping中的value属性是数组,所以可以定义多个路径,required属性默认是true,不必再写required=true,默认表示该参数是必须要有的,如果写required=false,表示该参数是可选的,可有可无。
1:
@PostMapping("/queryCurWeatherNullById/{id}/{name}")@Overridepublic List<WeatherPO> queryCurWeatherNullById(@PathVariable("id") Long id,@PathVariable("name") String name) {
如上所示,如果路径是/queryCurWeatherNullById/1/str正确,但是如果是/queryCurWeatherNullById或
这篇关于PostMapping,GetMapping访问多个路径,报错500解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!