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
@ResponseBodyor returnResponseEntityobjects to bypass the model and view and write data directly to the response body. - The
@RestControllerannotation simplifies REST controllers, eliminating the need to use@ResponseBodyon handler methods. - Spring Data repositories can automatically be exposed as REST APIs using Spring Data REST.
