Chapter 4
Creating Your Second Web Application
This chapter gives step-by-step instructions on coding and running the firstcup web application, which uses the dukes-age web service described in Chapter 3, Creating Your First Java EE Application. The firstcup web application is a more complicated application, and uses several different Java EE APIs.
The firstcup example application retrieves, or “consumes,” the data from the dukes-age web service. A JavaServer Faces web front-end asks users to enter their birthdays to find out who is older, the user or Duke. This data is stored in a Java DB database table using the Java Persistence API. The business logic, which provides the core functionality of the application, is handled by an enterprise bean.
All the tiers described in Tiered Applications are present in the firstcup web application. The web or client tier is the JavaServer Faces front-end. The enterprise information systems, or EIS, tier is the Java DB database. The business tier is the enterprise bean.