@PathVariable
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
public UserDto getById(@PathVariable("id") Long id){
...
}
@RequestParam
参数都使用@RequestParam注入,那么地址的拼写是不需要加参数的。
@RequestMapping(value = {"/findDictionarybyTypeId"},
method = RequestMethod.GET)
@ResponseBody
public ItooResult findDictionarybyTypeId(HttpServletRequest request,
HttpServletResponse response, @RequestParam(required = false, defaultValue = "")
String typeId, @RequestParam(required = false, defaultValue = "") String dictionaryInfo)
————————————————
版权声明:本文为CSDN博主「冯浩月」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/m18633778874/article/details/80728490
此段代码中@PathVariable可以将URL中的占位符参数{**}绑定到处理器类的方法形参中(占/{})
引用于:https://blog.csdn.net/sswqzx/article/details/84194979
引用于:https://blog.csdn.net/sswqzx/article/details/84194979