Maven Installation and Setup (Windows + Unix)

This Article provides a complete guide to setup Apache Maven in your Windows or Unix based environment(Linux, Solaris and Mac OS X). Maven version used in this article is Apache Maven 3.1.1. 1. Download Apache Maven & Extract it Download latest Maven version from Apache Maven site for your environment. Unzip or Untar it on…

Continue reading

Spring 4 + Quartz Scheduler Integration Example

In this post we will see how to schedule Jobs using Quartz Scheduler with Spring. Spring provides couple of classes that simplify the usage of Quartz within Spring-based applications. Other interesting posts you may like Secure Spring REST API using OAuth2 AngularJS+Spring Security using Basic Authentication Secure Spring REST API using Basic Authentication Spring 4…

Continue reading

Spring Job Scheduling with @Scheduled & @EnableScheduling Annotations

In this post we will how to Schedule a Job in Spring using Spring @Scheduled and @EnableScheduling Annotations based Configuration. Other interesting posts you may like Secure Spring REST API using OAuth2 AngularJS+Spring Security using Basic Authentication Secure Spring REST API using Basic Authentication Spring 4 Caching Annotations Tutorial Spring 4 Cache Tutorial with EhCache…

Continue reading

Spring Job Scheduling using TaskScheduler (XML Config)

In this post we will see how to Schedule a job in Spring using Spring Task Scheduler with XML configuration. Annotation based configuration is explained in Annotation based scheduling configuration post. Other interesting posts you may like Secure Spring REST API using OAuth2 AngularJS+Spring Security using Basic Authentication Secure Spring REST API using Basic Authentication…

Continue reading

Spring Dependency Injection Annotation Example, Beans Auto-wiring using @Autowired, @Qualifier & @Resource Annotations Configuration

Spring Dependency Injection Annotation example + Spring Auto-wiring Annotation example. This article explains Spring Dependency Injection and Beans auto-wiring using Spring @Autowired annotation. @Autowired can be applied on a bean’s constructor, field, setter method or a config method to autowire the dependency using Spring’s dependency injection. @Autowired wires the dependency using bean datatype. If you…

Continue reading

Spring Beans Auto-wiring Example using XML Configuration

Bean wiring corresponds to providing the dependency one bean might need to complete it’s job. In Spring, beans can be wired together in two ways : Manually and Autowiring Manual wiring : using ref attribute in <property> or <constructor> tag In this approach, we use the ‘ref’ attribute to refer to exact bean we want…

Continue reading

Spring Dependency Injection Example with Constructor and Property Setter (XML)

A primary goal of Spring is to keep components as independent as possible, which allows these components to be reused , and also provides possibility to unit test them independently. Spring Dependency Injection principal fulfill this goal via injecting the dependency one component might need to complete its job, rather that component itself finding it’s…

Continue reading

Spring 4 + Hibernate 4 + MySQL+ Maven Integration example (Annotations+XML)

In this tutorial , we will integrate Spring 4 with Hibernate 4 using annotation based configuration. We will develop a simple CRUD java application , creating hibernate entities, saving data in MySQL database , performing database CRUD operations within transaction, and learn how different layers interacts with each-other in typical enterprise application, all using annotation…

Continue reading

Spring @Profile Example

In this tutorial we will explore Spring @Profile annotation and use it to make different set of beans or configuration available conditionally on different environments. We will also discuss corresponding XML based profile configuration for comparison. Let’s imagine you have an application which includes database-interaction. You might want to configure one dateSource (for MySQL e.g.)…

Continue reading

Spring @PropertySource & @Value annotations example

In this post we will see how to read values from properties files using Spring @PropertySource & @Value annotations. We will also discuss about Spring Environment interface. We will see corresponding XML configuration as well for side-by-side comparison. Spring @PropertySource annotations is mainly used to read from properties file using Spring’s Environment interface. This annotation…

Continue reading