xxxxxxxxxx
@Controller
@ResponseBody
public class MVCController {
.. your logic
}
@RestController
public class RestFulController {
your logic .
}
xxxxxxxxxx
@Controller is used to mark classes as Spring MVC Controller.
@RestController annotation is a special controller used in RESTful Web services, and it's the combination of @Controller and @ResponseBody annotation.
It is a specialized version of @Component annotation