Category: Spring Core
Spring XML Based Configuration Example
This tutorial shows you how to use Spring XML Based Configuration. We create a simple service called CoffeeMachine which will display a simple message to the console. We configure our application using XML Based...
Asynchronous service with spring @Async and Java Future
In this tutorial we use Java’s Future callback together with Spring @Async Thread execution. Whenever you want to make a time consuming task the best practice is to start this in a new thread...
Spring Inject Logger by Annotation Example
This tutorial: Spring Inject Logger by Annotation Example show you how to Inject a logger by Annotation. Dependencies We use slf4j logger interface and log4j logger implementation. Next add the spring dependencies to your...
Loading a property or system property using spring @Value
In the previous tutorial we saw how you can load properties from a file. In this tutorial we will show you how to inject these properties or system properties into a spring bean using...
Load Properties from a file with Spring Property Placeholder
In this example we will show you how to load properties from a file using spring property placeholder. With PropertyPlaceholderConfigurer you can externalize property values from a bean definition in a separate file. This...
Spring XML Auto Component Scanning / Mapping Componetns
This example shows how to use spring xml auto component scanning. We will compare the traditional way using only xml to configure your spring beans and use the auto component scanning option. The last...