Component Scanning Filters, Conditional Bean Registration and Bean Naming Strategies
Learn Component Scanning Filters, Conditional Bean Registration and Bean Naming Strategies (Phase 5 · Stereotype Annotations (Core), Spring Core) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Component scanning and filters • @ComponentScan scans the classpath under the given packages for classes with stereotype annotations. Filters refine it: includeFilters / excludeFilters with FilterType ANNOTATION , ASSIGNABLE_TYPE , ASPECTJ , REGEX , CUSTOM ( TypeFilter ); useDefaultFilters = false to start from nothing. Use to exclude test configs/legacy classes or to include classes without annotations (all implementors of an interface). • Boot's @SpringBootApplication includes TypeExcludeFilter and AutoConfigurationExcludeFilter so slice tests and auto-configurations are not scanned...