adspace


What is difference between @controller and @restcontroller in spring boot? : Spring Boot

Answer Posted / Kaushlendra Pratap Singh

@Controller is a component that handles requests for any type of application, not just RESTful web services. It supports multiple types of responses (HTML, JSON, XML, etc.). On the other hand, @RestController is a specialization of @Controller designed specifically for handling RESTful web services. It only generates JSON responses by default.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between @controller and @restcontroller in spring?

556


What is lazy class?

490


How can you inject java collection in spring?

518