controller层获取参数,使用@RequestParam与不使用的区别
//带注解@RequestParam
@RequestMapping("/list")
public String test(@RequestParam Integer parentId) {
}
//不带注解@RequestParam
@RequestMapping("/list")
public String test(Integer parentId) {
}
第一种:带注解@RequestParam,在访问接口时,必须带着参数parentId,否则会报错。即需要以【local.
原创
2020-06-17 16:27:47 ·
1119 阅读 ·
0 评论