http://localhost:8080/emp/1

有以上请求,我们controller要怎么获取请求中传递的参数1呢?

通过PathVariable注解,如下:

@DeleteMapping("/emp/{id}")
    public String deleteEmp(@PathVariable("id") Integer id){
  
}

 

相关文章:

  • 2022-12-23
  • 2021-07-27
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2023-02-04
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案