@PathVariable main function: mapping the placeholders bound to the URL URL
with placeholders is a new feature of Spring3.0, the {xxx} placeholders in the URL can be bound to the operation via @PathVariable("xxx") The method's entry into the parameters.
E.g:
@RequestMapping("/user/{id}")
public String testPathVariable(@PathVariable("id") String id){
System.out.println("路径上的占位符的值="+id);
return "success";
}
If your request is localhost:8080/user/admin, you can output:
路径上的占位符的值=admin