Skip to content

7.4 Summary

  • REST endpoints can be created with Spring MVC, with controllers that follow the same programming model as browser-targeted controllers.
  • Controller handler methods can either be annotated with @ResponseBody or return ResponseEntity objects to bypass the model and view and write data directly to the response body.
  • The @RestController annotation simplifies REST controllers, eliminating the need to use @ResponseBody on handler methods.
  • Spring Data repositories can automatically be exposed as REST APIs using Spring Data REST.

Released under the MIT License.