Introduction
The @RestController annotation tells Spring Boot to handle web requests and send back data, usually in JSON format, instead of a web page.
When building a web API that sends data to a client app like a mobile app or frontend JavaScript.
When you want to create a simple service that returns JSON or XML responses.
When you do not need to return HTML views but only data.
When you want to quickly create RESTful web services without extra configuration.