1. Introduction
The PDF for this document is available |HERE|.
The examples in this 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 URL [http://tahe.developpez.com/java/primefaces]. It uses features from version 2 of JSF,
- and the projects are Maven projects.
Java EE refers to 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. At the same time that JDK 1.5 introduced many new features to the Java language, Sun introduced new technologies based on this enhanced language to address shortcomings in those same technologies in 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 5 is Java 6.
Books by Antonio Goncalves:
- Java 5, published by Eyrolles
- Beginning Java 6 Platform with Java 3, published by Apress
are excellent books for learning about Java EE 5 and Java EE 6 technologies. All the major Java EE technologies are covered in the context of realistic case studies. The author has a website that readers are invited to visit.
This document explores some of the technologies of Java EE 5. In it, we create a basic three-tier application [présentation, métier, accès aux données] 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 technologies, such as EE, are not covered here, such as MDB (Message Driven Bean) or EJB3 (stateful). To learn more about them, refer to Antonio Goncalves’ books.
There are other open-source technologies available for building 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 TD (Guided Project) used in the 5th year of the ISTIA engineering program at the University of Angers [http://www.istia.univ-angers.fr]. This TD 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 TD asks questions without providing the answers. It is up to the student to find them.
The Java learning guide EE presented here requires an estimated time investment of 50 to 100 hours. The document contains a lot of code, making it possible to copy and paste. Furthermore, all Netbeans projects are described in detail. Overall, the document provides the outlines of 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 IDE Netbeans. Netbeans is a fairly resource-intensive product: allow for 1 GB of RAM to work comfortably. It can be downloaded from url [http://www.netbeans.org/].
The document refers to the following courses:
- Java 5 Persistence in Practice: [Java 5 Persistence Through Practice (2007)] - provides the tools to build the data access layer with JPA (Java Persistence API)
- Introduction to the Java Language [Introduction to the Java Language (1998)] - for beginners
- Introduction to Java Server Faces through examples, Primefaces and Primefaces mobile [Introduction to Java Server Faces, PrimeFaces, and PrimeFaces Mobile with Examples (2012)]
These course materials are subsequently referenced as [ref1], [ref2], and [ref3].
Serge Tahé, June 2012.