Skip to main content

@Component, @Service, @Repository, @Controller, @RestController, @ControllerAdvice and Custom Stereotypes

Learn @Component, @Service, @Repository, @Controller, @RestController, @ControllerAdvice and Custom Stereotypes (Phase 5 · Stereotype Annotations (Core), Spring Core) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

The stereotype annotations • All are meta-annotated with @Component , so scanning detects them. Use the most specific one: it documents intent, enables layer-specific processing and helps pointcuts ( within(@Service *) ).

More lessons in Phase 5 · Stereotype Annotations (Core)