spring路由

50次阅读

共计 196 个字符,预计需要花费 1 分钟才能阅读完成。

controller 获取路由参数(两种形式)
【1】路由 ”xxx/edit/”+id;
在方法头上添加:@GetMapping(“/edit/{id}”) 或在方法参数添加:String edit(@PathVariable(“id”) String id){
【2】路由 ”xxx/edit/?id=”+id;
直接在方法中加:String edit(@RequestParam(“id”) String id){

正文完
 0