Skip to main content

@Configuration

Learn @Configuration (Spring MVC Configuration, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes @Configuration marks a class as a source of bean definitions. Spring reads its @Bean methods and registers the returned objects in the container. Stereotype : it is itself meta-annotated with @Component , so component scanning picks it up. Typical use : define infrastructure beans ( DataSource , ObjectMapper , view resolvers) and import other configuration with @Import .

More lessons in Spring MVC Configuration