Loading tutorials
@Component, @Autowired, @Configuration and @Bean, and that you have built and run a Spring or Spring Boot application. Later chapters build on the ideas introduced here.2 min read@Component, @Configuration and @Bean, and can run a Spring application. It shows what the container stores before it creates any object. Many startup errors and surprises come from this stage.2 min read@Component, @Autowired, @Configuration, @Bean), and how to run a Spring or Spring Boot application. It covers the two steps that happen before any initialization callback runs: creating the object and injecting its depend2 min read@Component, @Autowired, @Bean), and how to run a Spring or Spring Boot application. It gives the overview. Later chapters cover each callback in detail.2 min read@Component, @Bean, @Configuration), and how to run a Spring application. It covers the three ways to run code after Spring has built a bean.2 min read@Component, @Bean), and how to start a Spring application. Destruction callbacks let a bean release resources when the container shuts down. Examples are closing a connection pool, flushing a buffer, or stopping a thread2 min read@Component and run a Spring application.2 min read@PostConstruct, afterPropertiesSet) and can run a Spring application.2 min read@PostConstruct, @PreDestroy, InitializingBean, DisposableBean, Aware interfaces and BeanPostProcessor. Here you put them in order and check that order by running code.1 min read@Component, @Bean and constructor injection, and that you can run a Spring application. It also assumes you have seen the lifecycle phases from earlier chapters.2 min read@Bean, @Component and constructor injection, and that you can run a plain Spring context. It covers when Spring creates a singleton bean: at startup (eager) or on first use (lazy).2 min read@Component, @Autowired, @Bean) and the difference between singleton, prototype and web scopes. It covers what goes wrong when a long-lived bean depends on a shorter-lived one, and two ways to fix it.2 min read@Scope works. Custom scopes are rarely needed. Reach for one only when the built-in scopes don't match the lifetime you need, such as one instance per tenant, per thread, or per batch job.2 min read