SpringMVC common annotations:
- @Controller Responsible for registering a bean into the spring context。
- @RequestMapping The annotation specifies which URL requests the controller can handle。
- @RequestBody This annotation is used to read the body of the Request, using the default configuration of the system HttpMessageConverter for parsing, and then bind the corresponding data to the object to be returned. The object data returned by HttpMessageConverter is then bound to the parameters of the method in controller。
- @ModelAttribute Use @ModelAttribute annotation on method definitions: Spring MVC calls the methods labeled @ModelAttribute at the method level one by one before invoking the target processing method.
- @PathVariable Using @RequestParam at the process method entry allows you to pass the request parameter to the request method.