@PathVariable与@RequestParam的区别
这里写自定义目录标题@PathVariable与@RequestParam的区别
@PathVariable与@RequestParam的区别
在spring MVC中,两者的作用都是将request里的参数的值绑定到contorl里的方法参数里的,区别在于,URL写法不同。
使用@RequestParam时,URL是这样的:http://host:port/path?参数名=参数值
使用@PathVariable时,URL是这样的:http://host:port/path/参数值
@RequestM
转载
2020-11-26 16:05:57 ·
185 阅读 ·
0 评论