Spring is a lightweight framework was written by Rod Johnson and was released under the Apache 2.0 license in June 2003. Spring framework is an open source framework which enables the Java developers to build robust application with ease, it has some popular concepts such as Inversion of Control / Dependency Injection and Autowiring. It even provides support for Struts, Hibernate, JSF, EJB etc.
In this example, we will learn how to create a simple hello world example in Spring 3.0.
Since Spring 3.o, a developer can add all the configuration into Java class rather than into XML file.
In spring, we will split a large XML configuration files into one or more smaller XML files for maintainability and we will finally import it in a common configuration file. @Import annotation does the same functionality for JavaConfig in Spring 3.
In this article, we will learn about the different types of the bean scopes which is available in Spring
In this article, we will learn how to learn to lazy initialize Spring bean using Bean Factory.
Bean factory is the more basic implementation of Spring IoC Container. Application context is the more advanced implementation. Both IoC containers will be having the same Bean configurations only.
In this article, we will learn How to Create and Configure Beans in the Spring IoC Container
In order to refer another bean then we have to use <ref> tag, in this article we will learn how to use it.
A factory bean in Spring serves as a factory for creating other beans within the Spring IoC container.
In this article, we will learn about the Spring Bean Life Cycle (Bean Initialization and Destruction)
In Spring we can create bean using Spring FactoryBean, FactoryBean is an interface and we need to give implementations for the methods in it. If you don’t want to go by that methodology but still want Java Factory Pattern to be implemented then we can go for Static Factory Method and Instance Factory Method.
Dependency Injection in Spring
Dependency Injection(DI) or Inversion of Control(IoC) is the prominent feature of Spring Framework. Dependency Injection is a design pattern which removes the dependency between objects so that our code becomes loosely coupled
In this article, we will look at how the Setter Injection Works.
We will learn how to perform Constructor Injection (<constructor-arg>) in Spring.
In this article, we will look at how the Setter Injection Works with primitive datatypes.
In this article, we will look at how the Setter Injection Works with objects.
Dependency Injection of List
Dependency Injection of Set
Dependency Injection of Map
Dependency Injection of Properties
In this article, let’s understand the difference between Setter and Constructor Injection.
In this article, we will learn how to resolve ambiguity which occurs when we have the one or more matching constructors.
Autowiring in Spring
Autowiring is a feature of Spring framework which lets you to Inject Dependency implicitly
In this article, we will learn about Autowiring byName
In this article, we will learn about Autowiring byType
In this article, we will learn about Autowiring constructor
Through Setter Injection we cannot make sure that values for all the properties have been injected in those cases @Requred annotation will help us manage the dependency
In this article, we will learn about how to use @Autowired, @Resource, @Qualifier, @Inject Annotation
In this Spring JdbcTemplate Example, let’s understand how JdbcTemplate eases the development effort.
In this Spring CRUD Example, we will build a Simple Spring Application and perform CRUD operations using Spring JdbcTemplate.
Spring comes with a bean factory post-processor called PropertyPlaceholderConfigurer which allows you to externalize those all the hard coded values into a properties file.
Spring MVC throws this exception when it is not able to find the “org.springframework.web.context.ContextLoaderListener” class which loads up the all the Spring MVC configuration files and other configuration files which is declared in the web.xml.