@RequestMAPPPING映射请求占位符@PathVariable注解

@PathVariable:通过@PathVariable 可以将URL 中占位符参数绑定到控制器处理方法的入参中

URL中的{xxx} 占位符可以通过 @PathVariable{"xxx"} 绑定到操作方法的入参中

@RequestMapping(value = "/h1/{id}")
public String h1(@PathVariable("id") Integer id){
    System.out.pringln("id.."+id);
    return "h1";
}
原文地址:https://www.cnblogs.com/KingTL/p/13033219.html