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



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

Answer / 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

More Spring Framework Interview Questions

What are beans in java spring?

1 Answers  


What is the basic concept of spring?

1 Answers  


How do you define the scope of a bean?

1 Answers  


Explain the spring framework.

1 Answers  


What is use of @repository in spring?

1 Answers  


What is introduction in spring aop?

1 Answers  


Why we need to integrate struts with spring?

1 Answers  


What is aop scoped proxy in spring?

1 Answers  


What does @repository do in spring?

1 Answers  


What are different types of autowire?

1 Answers  


What is around advice in spring?

1 Answers  


What is spring boot starter tomcat? : Spring Boot

1 Answers  


Categories