Spring inner bean examples
In Spring framework, whenever a bean is used for only one particular property, it’s advise to declare it as an inner bean. And the inner bean is supported both in…
How to inject value into bean properties in Spring
In Spring, there are three ways to inject value into bean properties: Normal way, Shortcut, “p” schema. Normal way: Inject value within a ‘value’ tag and enclosed with ‘property’ tag.…
Spring bean reference example
In Spring, beans can “access” to each other by specify the bean references in the same or different bean configuration file. If you are referring to a bean in different…
How to load multiple Spring bean configuration file
In a large project structure, the Spring’s bean configuration files are located in different folders for easy maintainability and modular. For example, Spring-Common.xml in common folder, Spring-Connection.xml in connection folder,…
Spring 3 JavaConfig @Import example
Normally, you will split a large Spring XML bean files into multiple small files, group by module or category, to make things more maintainable and modular. In Spring3 JavaConfig, the…
Spring loosely coupled example
The concept of object-oriented is a good design to break your system into a group of reusable objects. However, when system grows larger, especially in Java project, the huge object…
Spring 3 JavaConfig example
Since Spring 3, JavaConfig features are included in core Spring module, it allow developer to move bean definition and Spring configuration out of XML file into Java class. But, you…
Spring 3 hello world example
This tutorial shows you how to create a simple hello world example in Spring 3.0. Technologies used in this article :Spring 3.0.5.RELEASE, Maven 3.0.3, Eclipse 3.6, JDK 1.6.0.13 . In…
Maven + Spring hello world example
This quick guide example uses Maven to generate a simple Java project structure, and demonstrates how to retrieve Spring bean and prints a “hello world” string. Technologies used in this…
Spring Profiles example
Spring @Profile allow developers to register beans by condition. For example, register beans based on what operating system (Windows, *nix) your application is running, or load a database properties file…