5
spring | @PathVariable
source link: https://benpaodewoniu.github.io/2022/11/17/spring16/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
spring | @PathVariable
@PathVariable
注解讲解。
- URL
- http:127.0.0.1:8888/hello/getbyid/12
@RequestMapping(value = "/getbyid/{id}", method = RequestMethod.GET)
@ResponseBody
private Map<String, Object> getbyid( HttpServletRequest request,@PathVariable("id") int idnum){
Map<String, Object> modelMap = new HashMap<String, Object>();
modelMap.put("idnum", idnum);
return modelMap;
}
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK