Skip to main content

Component Scanning & ApplicationContext

Learn Component Scanning & ApplicationContext (Spring Framework Fundamentals, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

How Spring Finds Your Classes Annotating a class @Component does not register it. Something has to go looking. Component scanning is that search: at startup Spring walks a set of packages, reads every class it finds, and registers the ones carrying a stereotype annotation. Two conditions must both hold for a class to become a bean:

More lessons in Spring Framework Fundamentals