Scoped Beans As Dependencies in Spring

1. Overview In Spring applications, most of the beans are singletons. And we generally achieve the collaboration by declaring beans as dependencies...

Continue Reading

Create Beans Conditionally using Spring

1. Introduction In this tutorial, we'll look at how we can create beans conditionally using Spring. For this purpose, we'll use the @Conditional an...

Continue Reading

Guide to @Import in Spring

1. Overview The @Import annotation is the primary mechanism to import @Bean definitions typically contained in @Configuration classes. Although it ...

Continue Reading

Access Files As Resources using Spring

1. Overview In this tutorial, we're going to look at how we can access files as Resources using Spring. In the end, the approaches detailed here wi...

Continue Reading

Define Spring @Bean Dependencies

1. Overview In this tutorial, we're going to look at the ways to define dependencies for Spring @Bean methods. 2. Sample Application Let's start wi...

Continue Reading

Spring Candidate Component Index

1. Introduction Spring provides classpath scanning for finding annotated components under the given packages. Although this process is fairly fast,...

Continue Reading

Close Spring Application Context

1. Overview In this tutorial, we'll look at how we can close the Spring application context. It is important to close the context properly because ...

Continue Reading

Initialize Spring Application Context

1. Overview In this tutorial, we're going to examine how we can initialize the Spring application context - in other words, the Spring container. A...

Continue Reading

CGLIB Proxying in Spring @Configuration

1. Overview In this quick tutorial, we'll talk about CGLIB proxying in Spring @Configuration classes. Mainly, we'll look at some practical examples...

Continue Reading

Naming Spring Beans with @Bean

1. Overview In this quick tutorial, we're going to examine how we can name our Spring beans using the @Bean annotation. 2. Sample Application Let's...

Continue Reading