Monday, June 27, 2011

Setting up a Java EE 6 development environment

This tutorial explains in short how to set-up a typical environment to develop Java EE 6 based applications. There is no prerequesite to this tutorial other then a working Windows XP client with sufficient CPU power and memory. During the tutorial we will need to install the following components:
  • Java 6 JDK Update 26
  • Eclipse IDE for Java EE Developers 3.6.2 (Helios)
  • Maven 3.0.3
  • Glassfish 3.1
I suggest that you create a folder where you drop all the stuff we need to set-up the environment. My Folder is C:\jee6. I will call that <dev_home> when I refer to it.
Note: In one of my recent posts I explained how to set-up a Spring environment. This process is very simmilar, therefore I will only explain deviations in this Java EE set-up.
In this tutorial we will create a little demo project. The sample application uses JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included). The demo can be used to start development of your own enterprise project.

Tuesday, June 21, 2011

Type-safe dependency injection in Spring 3 IoC-Container

CDI provides the javax.inject.Qualifier annotation. This annotation is used to identify the bean being searched during dependency injection by type (instead by name). In this article I provide a quick guide to set-up Spring IoC to do the same thing with the org.springframework.beans.factory.annotation.Qualifier annotation.

Thursday, June 16, 2011

Setting up a Spring 3 development environment

This tutorial explains in short how to set-up a typical environment to develop Spring based applications. There is no prerequesite to this tutorial other then a working Windows XP client with sufficient CPU power and memory. During the tutorial we will need to install the following components:
  • Java 6 JDK Update 26
  • Eclipse IDE for Java EE Developers 3.6.2 (Helios)
  • Maven 3.0.3
  • Tomcat 7.0.14
I suggest that you create a folder where you drop all the stuff we need to set-up the environment. My Folder is C:\spring. I will call that <dev_home> when I refer to it.
Note: Setting up a Spring environment is possible in different ways. See here for example on how to setup a dynamic web project in Eclipse using Maven for dependency management. Combine it with this link on how to download Spring dependencies into Eclipse using Maven. However, I personally prefer to do a step-by-step installation of the separate components and integrate them myself. This way I learn a lot about how the tools work together and how to integrate them – and how to fix them when something is not working!
In this tutorial we will create a little demo project. It is the well known Spring MVC, Spring Core, JPA, Hibernate ("web container only") development stack that we use. This stack is used successful in many  productive enterprise applications. The demo can be used to start development of your own enterprise project.