adspace


What is @controller and @restcontroller?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lazy class?

490


How can you inject java collection in spring?

518


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

556