1. Introduction
The PDF of this document is available |HERE|.
The examples in the document are available |HERE|.
This document is based on a previous document written in 2010 and titled "Introduction to Java EE with NetBeans 6.8 and the GlassFish v3 Server." This version primarily includes the following changes:
- the JSF (Java Server Faces) section is covered in a separate document: "Introduction to Java Server Faces, PrimeFaces, and PrimeFaces Mobile," available at [http://tahe.developpez.com/java/primefaces]. It uses features from JSF version 2,
- the projects are Maven projects.
Java EE stands for Java Enterprise Edition. J2EE (Java 2 Enterprise Edition) was the previous term. J2EE refers to the Java technologies used to create enterprise applications with JDK 1.4 or earlier. As JDK 1.5 introduced numerous new features to the Java language, Sun introduced new technologies based on this enhanced language to address shortcomings in those same technologies within J2EE. The term Java EE 5 was then used to refer to the set of technologies that work together to create an enterprise application using the Java platform. At the time of this document’s update, the latest version of Java EE is Java EE 6.
Books by Antonio Goncalves:
- Java EE 5, published by Eyrolles
- Beginning Java EE 6 Platform with Glassfish 3, published by Apress
are excellent books for discovering the technologies of Java EE 5 and Java EE 6. All the important Java EE technologies are reviewed in the context of realistic case studies. The author has a website [http://www.antoniogoncalves.org] that readers are invited to visit.
This document explores some of the technologies in Java EE 5. We create a basic three-tier application [presentation, business logic, data access] available in several versions:
A web application using the following technologies:
- Java Server Faces: for the web layer
- EJB3 or Spring: for the business layer
- EJB3 or Spring, JPA/Hibernate, JPA/EclipseLink: to create different data access layers
A client/server application using the following technologies:
- Swing: for the client GUI layer with Spring support
- EJB3 or web service: for the server layer
Certain Java EE technologies are not covered here, such as MDBs (Message Driven Beans) or stateful EJB3s. To learn more about them, refer to Antonio Goncalves’ books.
There are other open-source technologies available for creating three-tier applications. A very popular combination is Spring (http://www.springframework.org/) / Hibernate (http://www.hibernate.org/). To allow the reader to compare EJB3 and Spring technologies, the previous application has versions where Spring replaces EJB3.
This document is a tutorial (TD) used in the fifth year of the ISTIA engineering school at the University of Angers [http://www.istia.univ-angers.fr]. This tutorial describes the application to be built, the Java technologies to be used, and where to find information. The proposed solution is often very structured. The assignment poses questions without providing the answers. It is up to the student to find them.
The Java EE learning process outlined here requires an estimated time investment of 50 to 100 hours. The document contains a significant amount of code, making it possible to copy and paste. Additionally, all NetBeans projects are described in detail. Overall, the document provides the frameworks for the solutions, and students are asked to fill in certain details. The document can be useful even to someone who cannot or does not want to invest that much time. One can focus solely on the architectures described and skip the code section that is the subject of the questions.
To develop and run the application, we use the NetBeans IDE. NetBeans is a fairly resource-intensive application: allow for 1 GB of RAM to work comfortably. It can be downloaded from the URL [http://www.netbeans.org/].
This document refers to the following courses:
- Java 5 Persistence in Practice: [http://tahe.developpez.com/java/jpa] - provides the tools to build the data access layer with JPA (Java Persistence API)
- Introduction to the Java Language [http://tahe.developpez.com/java/cours] - for beginners
- Introduction to Java Server Faces, PrimeFaces, and PrimeFaces Mobile through Examples [http://tahe.developpez.com/java/primefaces]
These course materials are subsequently referenced as [ref1], [ref2], and [ref3].
Serge Tahé, June 2012.