SpringMvc中的@PathVariable注解

@PathVariable用法:

 绑定URL的模板变量值(URL 中的 {xxx} 占位符可以通过@PathVariable("xxx") 绑定到操作方法的入参中。

 public 类型  方法名(@PathVariable(value="type") 类型 type ){   };

eg:

   @RequestMapping(value="{xxx}")
    public ModelAndView toPage(@PathVariable("xxx")String page){
       System.out.println(page)
    }

猜你喜欢

转载自blog.csdn.net/zhangpeng123_/article/details/84384851