Compound Property Names in Spring

With this example I will show you how compound or nested property names work in Spring application. Compound or nested property names are perfectly legal when setting bean properties, as long as all components of the path except the final property name are non-null. You can use compound or nested property names when you set bean properties, as long as…

Depends-on in Spring

With this example I will show you how depends-on (@DependsOn annoattion) works in Spring application. Depends-on is basically used when you have a dependency on another bean without which you cannot proceed with the execution of your operations in current bean. Or if you need to initialize any bean before another bean, depends-on does this job. While creating bean you…

Collection merging in Spring

With this example we will show you how to merge Collections in Spring. Since Spring 2.0, the container supports merging of collections. You can define <prop/>, <list/>, <map/> and <set/> of parent-style and then you can inherit the child-style element and override values of each type from parent collections. That is, the child collection’s values are the result of merging…

Collection Element Set In Spring

Introduction Here in this example I am going to show you how to work with collection element set in Spring Boot application. Actually, a set of properties will be injected into a Spring bean. These properties are configurable in theĀ application.propertiesĀ or XML configuration files. So, you declare set of values in the configuration or properties file and Spring bean pick them…

Working with Collection Element Type Map in Spring Application

With this example I will show you how to inject Collection Type Map in Spring Bean. I am going to show you in Spring Boot framework how to read map based key/value pair. I will also show you how to read the map based values from traditional XML config file. In order to show how Collections can be injected in…

Collection Element List in Spring

Collection Element List With this example I will show you how to inject List elements in Spring application. The collection type I am going to show you is List or Array. I am going to use Spring Boot framework. I will show you various ways of loading a list of configurable properties in Spring application. The list of elements you…

Working with Collection Element Props in Spring Application

With this example I will show you how to inject Collections type Props in Spring applications. This is similar to the element type Map I had shown in another example. I am going to use Spring Boot framework but I will show you both using application.properties file as well as traditional XML config file to configure the props elements. In…

Injecting properties value in Spring

This tutorial will show you how we can auto inject value from properties file in Spring. For this tutorial we will create a standalone maven project in Eclipse. If you already have an idea on how to create a maven project in Eclipse will be great otherwise I will tell you here how to create a maven project in Eclipse….

Spring 3, REST using Jersey 2.6 and Grizzly integration example

In this tutorial I will show you how to integrate REST using Jersey 2.6, Spring 3 and Grizzly web server. So I will use here Grizzly web server so we don’t need to use any other external webserver. I had been googling for many times but I did not get any satisfactory example on REST using Jersey 2.6 with Spring…

Integrate Spring 3, Struts 2 and Hibernate 3

Introduction This tutorial shows how to integrate Spring 3, Struts 2 and Hibernate 3 in the following example. In this example, Struts 2 will be used as a web framework and Spring 3 will be used as a core service. We will use ORM (Object Relational Mapping) framework Hibernate for our persistent layer to interact with database. We are going…