MAY 10, 2000
Writing Enterprise Applications with
Java 2 SDK, Enterprise Edition
by Monica Pawlan
MAY 10, 2000
copyright 1995-99 Sun Microsystems, Inc.
As used in this document, the terms “Javavirtual machine” or “Java VM” mean a virtual machine for the Java
platform.
PREFACE
MAY 10, 2000 III
Preface
This tutorial introduces you to the APIs, tools, and services provided in the Java 2 Enter-
prise Edition (J2EE) Software Developer Kit (SDK). You can get the free J2EE SDK
(http://java.sun.com/j2ee/download.html) to use for demonstrations, prototyping,
educational use, and verifying J2EE application portability.
To support these uses the J2EE SDK comes with J2EE development and deployment tools,
Java Web Server technology, Cloudscape database, Java Software application server,
Extensible Markup Language (XML) support, the J2EE APIs, and Java Plug-In. Java Plug-
In lets you run Java 2 applets in browsers that support an earlier release of the Java Runtime
Environment (JRE).
Note: This is a work in progress. Links to new lessons are turned on when they become
available. Submit comments and suggestions to jdcee@sun.com
PREFACE
IV MAY 10, 2000
CONTENTS
MAY 10, 2000 V
Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Lesson 1
A Simple Session Bean. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Example Thin-Client Multitiered Application 1
J2EE Software and Setup 3
Unix: 3
Windows: 3
Path Settings 3
Unix: 3
Windows: 3
Class Path Settings 4
Unix: 4
Windows: 4
J2EE Application Components 4
Create the HTML File 6
HTML Code 6
Create the Servlet 6
Import Statements 6
init Method 7
doGet Method 7
Servlet Code 9
Create the Session Bean 10
CalcHome 11
Calc 12
CalcBean 12
Compile the Session Bean and Servlet 13
Compile the Session Bean 13
Compile the Servlet 13
Start the J2EE Application Server 14
Unix: 14
Windows: 14
Start the Deploy Tool 14
Unix: 14
Windows: 14
Deploy Tool 15
评论0