background image

Building the Duke Bank Example

<< JavaServer Faces Custom Component | Creating the Bank Database Using Ant >>
<< JavaServer Faces Custom Component | Creating the Bank Database Using Ant >>

Building the Duke Bank Example

After the customer has been authenticated, the identifier provided by the customer is used as a
key to identify the customer's accounts. The identifier is retrieved from the FacesContext
object by the CustomerBean constructor, which saves it into the customerId property:
customerId = Long.parseLong(FacesContext.getCurrentInstance()
.getExternalContext().getUserPrincipal().getName());
Building, Packaging, Deploying, and Running the Duke's Bank
Application
To build the Duke's Bank application, you must have installed the tutorial bundle as described
in . When you install the bundle, the Duke's Bank application files are located in the
tut-install/javaeetutorial5/examples/dukesbank/ directory. This directory contains the
configuration files for creating the EAR, dukesbank.ear. The EAR consists of the following
three modules:
dukesbank-appclient
: The application client
dukesbank-ejb
: The enterprise beans and persistence entities
dukesbank-war
: The web client
After you build the source code, all the sub-modules will be built into their respective module
packages, and the resulting EAR file will reside in the
tut-install/javaeetutorial5/examples/dukesbank/dist/ directory.
Setting Up the Servers
Before you can package, deploy, and run the example, you must first set up the Java DB database
server with customer and account data, and you must add some resources to the Application
Server.
Starting the Application Server
Before you can start this tutorial, the Application Server must be running. For information on
starting the Application Server, see
"Starting and Stopping the Application Server" on page 68
.
Creating the Bank Database in NetBeans IDE
To create the database tables used in Duke's Bank, follow the instructions in
"Creating the
Database Tables in NetBeans IDE" on page 722
.
Building, Packaging, Deploying, and Running the Duke's Bank Application
Chapter 37 · The Duke's Bank Application
1075