About this document
Controller vs RestController Explained by sthaheer974 is a document available to read on EtoBox.
@Controller is used to create web pages that return HTML, while @RestController is designed for creating REST APIs that return JSON or plain text. The @ResponseBody annotation indicates that a method should return data directly in the HTTP response body instead of a view. The document provides examples and guidelines on when to use each annotation effectively.
- Author
- sthaheer974
- Language
- EN