SpringBoot参数访问

对于:

@RequestMapping("/practice/test/"){

  @GetMapping("{id}")

  public response test(@PathVariable Long id){

    System.out.println("id = " + id);

  }

}

访问的时候,URL为:127.0.0.1:8080/practice/test/1

即可在 MVC中接收到 id = 1

原文地址:https://www.cnblogs.com/luo-c/p/15272599.html