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){
【1】路由"xxx/edit/"+id;
在方法头上添加:@GetMapping("/edit/{id}")
或在方法参数添加:String edit(@PathVariable("id") String id){
【2】路由"xxx/edit/?id="+id;
直接在方法中加:String edit(@RequestParam("id") String id){
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论