What is @controller and @restcontroller?



What is @controller and @restcontroller?..

Answer / Preeti Rani

@Controller is a Spring MVC annotation that marks a class as a controller. @RestController is a specialization of @Controller that produces response bodies with HTTP messages and automatically selects the appropriate Content-Type based on the method annotated with @RequestMapping.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

How to handle exceptions in the spring mvc framework?

1 Answers  


What is the purpose of contextloaderlistener in spring?

1 Answers  


What is stateful bean in spring?

1 Answers  


What is the difference between @component and @controller?

1 Answers  


What are the important beans lifecycle methods?

1 Answers  


What is dao and dto in spring?

1 Answers  


What’s the difference between @component, @repository & @service annotations in spring?

1 Answers  


How do you teach annotations?

1 Answers  


What are the autowiring modes in spring?

1 Answers  


What is spring language?

1 Answers  


What are the ways by which configuration metadata can be provided to the spring container?

1 Answers  


Is jdk an api?

1 Answers  


Categories