We want to hear from you! Please send us your
FEEDBACK.
The following technical article may contain actual software programs in source code form. This source code is made available for developers to use as needed, pursuant to the terms and conditions of this
license.
This article consists of the following
parts:
In this five-part article, you will learn how easy it is to develop,
deploy, and verify a complete Java 2 Platform, Enterprise Edition
(J2EE platform) application. The article demonstrates these
processes using downloadable source code from a working J2EE
application that incorporates both web and server components. Using
the source code for this application, you learn how to verify that
the application is J2EE software compliant and how to migrate the application
so that it can be run on the Sun ONE Application Server. You also
learn how to develop the application "from scratch" using Sun's
integrated development environment, Sun ONE Studio 4 developer tools. Part 1 of this article describes the
components and architecture of the sample application that is used
throughout the demonstration. The Java Application Verification Kit (AVK) for
the Enterprise, the tool for verifying that an application will be portable across
all J2EE-compliant implementations, requires that the application
being verified first be deployed on the J2EE Reference
Implementation. Part 2 lists the steps
necessary to deploy the source
code provided on the J2EE Reference Implementation.
Part 3 describes
how to run the Java AVK for the Enterprise to verify that the
application is J2EE compliant. Part 4
shows you how to migrate the
application that you deployed on the J2EE Reference Implementation in
Part 2, so that you can run it on Sun ONE Application Server 7.0.
The tool you use in this section is the Sun ONE Migration Tool for
Application Servers. In Parts 1-4, you use source code that is
already developed and is provided to you. In Part 5, you learn how to
use Sun ONE Studio 4 developer tools to develop the source code for the application. The parts of this article are loosly
tied together, but can be read independently. Read the article in its
entirety to gain a complete understanding of the process, or choose
which parts to read according to your needs. To benefit the most from this article,
you should follow along with the step-by-step instructions. To do
this, you will need the following Sun products: All of these products are available
both for the Solaris Operating System (OS) and for Microsoft Windows.
While the steps listed in this article assume that you are running on
the Solaris OS, they can be easily modified to be used with Microsoft Windows. The sample application included with
this article is called the StockGrant application.
You can
download the source files
for the complete StockGrant application as a The StockGrant application uses a
web-based user interface that is intended to be used by an employee's
manager to grant that employee stock options. The employee's manager
is the user of this application.
When running this application, the user
inputs an employee number and a stock multiplier. "Behind the scenes",
the application's business logic determines the amount of stock to
give to the employee, puts that information into a relational
database, verifies to the user that the transaction was completed by
sending text to the user's browser screen and to a log file, and
sends an email verification to the user. Take a look at the architecture
diagram:
In the architecture diagram, you can
see that once the user inputs the data from a browser, the
Please continue with Part 2 to learn
how to deploy the StockGrant application on the J2EE Reference
Implementation so that you can run the Java Application Verification
Kit for the Enterprise to ensure that the application is portable to other J2EE
implementations, as described in Part 3.
Then, continue with Part 4 to learn how
to migrate the application so that it can be run on the Sun ONE Application
Server.
Alternatively, you can start with
Part 5 to see how
to develop this application "from scratch" using Sun ONE Studio 4
developer tools, so that it can be run on the Sun ONE Application Server.
Developing, Deploying, Verifying, and
Migrating J2EE Applications
by Santosh Dhavalikar, Mary McCarthy, C.K. Prasad, and Sujeet Vasudevan
to be Used on the Sun ONE Application
Server
(August 2003)
Introduction and Architecture of the Sample Application
Architecture of the Sample Application
.zip file.
The StockGrant application is extended from the application in the
J2EE Tutorial,
Developing Enterprise Applications Using the J2EE Platform,
written by Monica Pawlan in June 2000.
StockProcessor servlet takes over. The StockProcessor
servlet does the following:
StockProcessorBean,
to do the business logic of calculating the amount of stock to grant
to the employee.
StockBean,
to perform the container managed persistence (CMP) which saves the
employee number and the stock details in the relational database.
Database products are bundled with the J2EE Reference Implementation
and with the Sun ONE Application Server, and these bundled database
products are used with the StockGrant application.
StockMessageBean. The
StockMessageBean receives
the text message and sends it to the user's browser screen and to
the log file, and uses the JavaMail API to send the text as an email
message to the user.