Loading tutorials
@Configuration class. Here you will see the object that does the work: the ApplicationContext.2 min readApplicationContext creates beans, and basic Java annotations. It covers the three ways Spring can hand a dependency to a bean, and which one to choose.2 min readApplicationContext does. Here you will learn how Spring finds classes and registers them as beans without a line of manual wiring.2 min read@Service and @Component. Here you will register beans by writing Java methods instead of annotating classes.2 min read@Service, @Configuration and @Bean. It explains how Spring chooses a bean when several could fit a dependency.2 min read@Component or @Bean and inject them through constructors. A bean's scope controls how many instances the container creates and how long each one lives.2 min readApplicationContext creates singleton beans, and how constructor injection works. It covers the hooks Spring gives you to run code after a bean is ready and before it is thrown away.2 min read@Component or @Bean and inject them through constructors. It also assumes you use Spring Boot 3 (Spring 6), where application.properties is read automatically.2 min read@Component and @Bean, and that you know how Spring resolves injection by type. Here you will choose which beans exist in a given environment.2 min read@Bean methods, and how @Primary and @Qualifier choose between candidates. It covers the errors Spring raises when it cannot build the bean graph, and how to fix each one.2 min read@Configuration and @Bean, and basic JUnit 5. The goal is to decide when a test needs Spring and when plain Java is enough.2 min read