Here over this article, we are discussing different REST specific annotations in Spring.
We can annotate classic controllers with the _@Controller_
annotation. This is simply a specialization of the _@Component_
class, which allows us to auto-detect implementation classes through classpath scanning.
We typically use @Controller_ it in combination with an _@RequestMapping_
annotation for request handling methods_.
_@RestController_
is a specialized version of the controller. It includes the _@Controller_
and _@ResponseBody_
annotations, and as a result, simplifies the controller implementation.
#spring #java #spring-boot #spring annotations for rest services #rest services #spring annotations