http://localhost:8080/emp/1
有以上请求,我们controller要怎么获取请求中传递的参数1呢?
通过PathVariable注解,如下:
@DeleteMapping("/emp/{id}") public String deleteEmp(@PathVariable("id") Integer id){ }
http://localhost:8080/emp/1
有以上请求,我们controller要怎么获取请求中传递的参数1呢?
通过PathVariable注解,如下:
@DeleteMapping("/emp/{id}") public String deleteEmp(@PathVariable("id") Integer id){ }
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。