spring路由

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){

评论

暂无评论