MACROMEDIA JRun 4 Getting Started Manual

Category
Software manuals
Type
Getting Started Manual

This manual is also suitable for

Getting Started
with JRun
Trademarks
Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware,
Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage Designer, Backstage
Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, ColdFusion, Design in Motion, Director, Director
Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme 3D, Fireworks,
Flash, Fontographer, FreeHand, FreeHand Graphics Studio, Generator, Generator Developer's Studio, Generator Dynamic Graphics
Server, JRun, Knowledge Objects, Knowledge Stream, Knowledge Track, Lingo, Live Effects, Macromedia, Macromedia M Logo &
Design, Macromedia Flash, Macromedia Xres, Macromind, Macromind Action, MAGIC, Mediamaker, Object Authoring, Power
Applets, Priority Access, Roundtrip HTML, Scriptlets, SoundEdit, ShockRave, Shockmachine, Shockwave, Shockwave Remote,
Shockwave Internet Studio, Showcase, Tools to Power Your Ideas, Universal Media, Virtuoso, Web Design 101, Whirlwind and Xtra
are trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other
product names, logos, designs, titles, words or phrases mentioned within this publication may be trademarks, servicemarks, or
tradenames of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally.
This product includes code licensed from RSA Data Security.
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not responsible for
the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia
provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any
responsibility for the content on those third-party sites.
Apple Disclaimer
APPLE COMPUTER, INC. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE ENCLOSED
COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES. THE ABOVE EXCLUSION MAY
NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL RIGHTS. THERE MAY BE OTHER
RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE.
Copyright © 2002 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or
converted to any electronic or machine-readable form in whole or in part without prior written approval of Macromedia, Inc.
Part Number ZJR40M200
Acknowledgments
Project Management: Randy Nielsen
Writing: Rosemary Marano
Editing: Linda Adler and Noreen Maher
First Edition: May 2002
Macromedia, Inc.
600 Townsend St.
San Francisco, CA 94103
iii
CONTENTS
ABOUT THIS BOOK . . . . . . . . . . . . . . . . . . . . . . . . . . . VII
Developer resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
About JRun documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Printed and online documentation set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Accessing online documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Other resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x
Contacting Macromedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Part I Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
CHAPTER 1 Welcome to JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
About JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Benefits of server-side Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Benefits of using J2EE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
J2EE standards compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
JRun architectural model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
JRun features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
Development tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Using JRun with your Java IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Installing the Enterprise Deployment Wizard in your Java IDE . . . . . . . . . . . . . . . . . . . .13
What to do next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
CHAPTER 2 JRun Programming Model . . . . . . . . . . . . . . . . . . . . . . 15
Enterprise application architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Enterprise application design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
J2EE application architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
JRun support for the three-tier model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
JRun programming environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
JRun servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Using JRun servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Starting and stopping JRun servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Installed JRun servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
Web servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
JRun Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
JRun support for J2EE applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
About web applications and JRun. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
iv Contents
About EJBs and JRun. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
About enterprise resource adapters and JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
About enterprise applications and JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
CHAPTER 3 Introduction to J2EE . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
J2EE environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
J2EE platform technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Communication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
J2EE APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
EJB 2.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
Java Database Connectivity 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Java Servlet 2.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
JavaServer Pages 1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Java Message Service 1.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Java Transaction API 1.0 and Java Transaction Service. . . . . . . . . . . . . . . . . . . . . . . . . . .34
JavaMail 1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
JavaBeans Activation Framework 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Java API for XML 1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
J2EE Connector API 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Java Authentication and Authorization Service 1.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Java Naming and Directory Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Common Object Request Broker Architecture compliance. . . . . . . . . . . . . . . . . . . . . . . .36
Additional resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
CHAPTER 4 Using Servlets and JSP . . . . . . . . . . . . . . . . . . . . . . . . . 37
Using Java Servlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Invoking servlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Servlet benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Creating servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
JRun support for servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
JRun support for JSPs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Servlets and JSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
HTTP requests and responses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Writing results back to the client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
Using servlet filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
Using event listeners. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Handling exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Maintaining page context information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Working with sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Tracking an application’s context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Accessing configuration information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Writing servlets in Java. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Writing servlets as JSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
CHAPTER 5 Introduction to EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
EJB Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
The parts of an EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
Container services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
C o n t e n t s v
EJB types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
Session beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
Entity beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
Message-driven beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
Using EJB in JRun. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Stubless deployment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Deployment options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
EJB clustering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
XDoclet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
The Enterprise Deployment Wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
CHAPTER 6 Developing Web Applications . . . . . . . . . . . . . . . . . . . . 55
Introduction to web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
The benefits of web applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
Comparing web applications and enterprise applications . . . . . . . . . . . . . . . . . . . . . . . . .56
Using web applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
About the web application directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
The deployment descriptor (web.xml) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
Web applications, JRun servers, and web servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
Application mappings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Developing web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Creating a web application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Adding web application components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Deploying web applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Deploying a web application across a cluster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Packaging a web application for deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
Part II Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
LESSON 1 Servlet Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Setting up the development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Getting started with JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
Adding a JRun server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
Deploying the tutorial enterprise application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Adding JDBC data sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Compass Travel J2EE application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Coding the logon servlet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
What’s next?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
LESSON 2 JSP Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Creating a home page JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Compass Travel tutorial application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Accessing a JavaBean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
What’s next?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
LESSON 3 EJB Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
vi Contents
Using EJBs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
Invoking an EJB from a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Booking a trip reservation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
Examining the code for the reservation EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
Examining the code for the credit card EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94
Examining the code for the order EJB: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
Tutorial lessons summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
What’s next?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
LESSON 4 Web Services Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Using JRun web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
TravelNet web services application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
Setting up the development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Getting started with JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
Adding a JRun server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Deploying the TravelNet enterprise application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Authoring a web service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Generating WSDL from a published web service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Generating a web service proxy client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Creating and using a JSP-based proxy client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
vii
ABOUT THIS BOOK
Getting Started with JRun is for anyone using JRun to develop applications consisting of
Java Servlets, JavaServer pages, Enterprise JavaBeans, and Web Services. Part I of this
book provides a general introduction to JRun and J2EE. Part II contains tutorials to
show you how to build a simple J2EE application. In the tutorial lessons, you add a JRun
server and write the code for servlets, JSPs, JavaBeans, and EJBs.
This preface tells you how to access JRun and Macromedia resources, such as websites,
documentation, and technical support.
Contents
Developer resources .............................................................................................. viii
About JRun documentation.................................................................................... ix
Other resources........................................................................................................ x
Contacting Macromedia ........................................................................................xiv
viii About This Book
Developer resources
Macromedia, Inc. is committed to setting the standard for customer support in developer
education, documentation, technical support, and professional services. The
Macromedia website is designed to give you quick access to the entire range of online
resources. The following table shows the locations of these resources.
Resource Description
Information on JRun
http://www.macromedia.com/products/jrun
/http://www.macromedia.com/products/
jrun//a
Detailed product information on JRun and
related topics.
JRun Online Forum
http://webforums.macromedia.com/jrunhtt
p://webforums.macromedia.com/jrun/a
Access to experienced JRun developers
through participation in the Macromedia
Online Forums, where you can post messages
and read replies on many subjects relating to
JRun.
Developer Resources
http://www.macromedia.com/desdev/devel
oper/http://www.macromedia.com/desdev/
developer//a
All of the resources that you need to stay on
the cutting edge of JRun development,
including online discussion groups,
Component Exchange, Resource Library,
technical papers, and more.
JRun Support Center
http://www.macromedia.com/support/jrunh
ttp://www.macromedia.com/
support/jrun/a
Professional support programs that
Macromedia offers.
Tr a i n i n g
http://www.macromedia.com/support/traini
ng/http://www.macromedia.com/support/
training//a
Information about classes, on-site training,
and online courses offered by Macromedia.
Macromedia Alliance
http://www.macromedia.com/partners/http
://www.macromedia.com/partners//a
Connection with the growing network of
solution providers, application developers,
resellers, and hosting services creating
solutions with JRun.
About JRun documentation ix
About JRun documentation
JRun documentation provides support for all JRun users, including JSP developers,
servlet developers, EJB client developers, EJB bean developers, and system
administrators. The printed and online versions are organized to let you quickly locate
the information that you need. JRun online documentation is provided in HTML and
Adobe Acrobat formats.
Printed and online documentation set
The JRun documentation set consists of the following titles:
Accessing online documentation
All JRun documentation is available online in HTML and Adobe Acrobat formats. To
access the documentation, open the following file on the server running JRun:
jrun_root/docs/dochome.htm. JRun_root is the directory into which you installed JRun.
Macromedia provides online versions of all JRun books as Adobe Acrobat Portable
Document Format (PDF) files. The PDF files are included on the JRun CD and
installed in the JRun /docs directory, although they are an optional part of the
installation. You can access them by clicking the Product Documentation link on the
JRun Management Console Welcome window.
Book Description
Installing JRun Describes installing and configuring JRun.
Getting Started with JRun Provides a J2EE overview, concepts, and tutorials for
JSPs, servlets, EJBs, and web services.
JRun Administrator’s Guide Describes how to integrate a JRun server into an
existing environment.
JRun Programmer’s Guide Describes how to use JRun to develop JSPs, servlets,
custom tags, EJBs, and web services.
JRun Assembly and Deployment
Guide
Describes how to assemble and deploy the
components of a J2EE application.
JRun SDK Guide Provides information to OEM/ISV customers and
advanced users who embed, customize, or use the
APIs in JRun.
JRun Quick Reference Provides brief descriptions and syntax for JavaServer
Pages (JSP) directives, actions, and scripting elements.
Online Help Provides JMC users with usage notes, procedures, and
concepts.
x About This Book
Other resources
You can consult the following resources for more information on topics described in
JRun documentation.
Books
Servlets, JavaServer Pages, and Tag Libraries
JRun Web Application Construction
Kit
Drew Falkman
Macromedia Press, 2001
ISBN: 0789726009
Java Server Pages Application
Development
Scott M. Stirling, et al.
Sams, 2000
ISBN: 067231939X
http://www.moreservlets.comMore
Servlets and JavaServer Pages/a
Marty Hall
Prentice Hall PTR, 2001
ISBN: 0130676144
http://www.coreservlets.comCore
Servlets and JavaServer Pages/a
Marty Hall
Prentice Hall PTR, 2000
ISBN: 0130893404
Java Servlet Programming, Second
Edition
Jason Hunter and William Crawford
O'Reilly & Associates, 2001
ISBN: 0596000405
http://www.servletguru.comJava
Servlets Developer’s Guide/a
Karl Moss
McGraw-Hill/Osborne Media, 2002
ISBN: 0-07-222262-X
http://www.sourcestream.comInside
Servlets: Server-Side Programming
for the Java Platform, Second
Edition/a
Dustin R. Callaway
Addison-Wesley, 2001
ISBN: 0201709066
Web Development with JavaServer
Pages
Duane K. Fields and Mark A. Kolb
Manning Publications Company, 2000
ISBN: 1884777996
Enterprise Java Servlets Jeff Genender
Addison-Wesley, 2001
ISBN: 020170921X
Advanced JavaServer Pages David Geary
Prentice Hall, 2001
ISBN: 0130307041
Other resources xi
JavaServer Pages Hans Bergsten
O’Reilly & Associates, 2000
ISBN: 156592746X
JSP Tag Libraries Gal Schachor, Adam Chace, and Magnus Rydin
Manning Publications Company, 2001
ISBN: 193011009X
Core JSP Damon Hougland and Aaron Tavistock
Prentice Hall, 2000
ISBN: 0130882488
JSP: Javaserver Pages (Developer’s
Guide)
Barry Burd
Hungry Minds Inc., 2001
ISBN: 0764535358
Enterprise JavaBeans
http://www.middleware-company.c
omMastering Enterprise JavaBeans,
Second Edition/a
Ed Roman
John Wiley & Sons, 2002
ISBN: 0471417114
Enterprise JavaBeans, Third Edition Richard Monson-Haefel
O'Reilly & Associates, 2001
ISBN: 0596002262.
Professional EJB Rahim Adatia, et al
Wrox Press, 2001
ISBN: 1861005083
Special Edition Using Enterprise
JavaBeans (EJB) 2.0
Chuck Cavaness and Brian Keeton
Que, 2001
ISBN: 0789725673
Applying Enterprise JavaBeans:
Component-Based Development for
the J2EE Platform
Vlada Matena and Beth Stearns
Addison-Wesley Pub Co, 2000
ISBN: 0201702673
Enterprise Java Programming
Professional Java Server
Programming J2EE 1.3 Edition
Subrahmanyam Allamaraju, et al
Wrox Press, 2001
ISBN: 1861005377
Server-Based Java Programming Te d N e w a r d
Manning Publications Company, 2000
ISBN: 1884777716
xii About This Book
Online resources
Designing Enterprise Applications
with the Java 2 Platform, Enterprise
Edition
Nicholas Kassem
Addison-Wesley, 2000
ISBN: 0201702770
(free download at
http://java.sun.com/j2ee/download.html#blueprintsh
ttp://java.sun.com/j2ee/download.html#blueprints/a
)
Building Java Enterprise Systems
with J2EE
Paul Perrone and Venkata S.R. “Krishna” .R.
Chaganti
Sams, 2000
ISBN: 0672317958
J2EE: A Bird's Eye View (e-book) Rick Grehan
Fawcette Technical Publications, 2001
ISBN: B00005BAZV
Java Message Service Richard Monson-Haefel and David Chappell
O’Reilly and Associates, 2001
ISBN: 0596000685
J2EE Connector Architecture and
Enterprise Application Integration
Rahul Sharma, et al
Addison-Wesley, 2001
ISBN: 0201775808
Building Web Services with Java:
Making Sense of XML, SOAP,
WSDL and UDDI
Sim Simeonov, Glen Daniels, et al
Prentice Hall, 2002
ISBN: 0672321815
Architecting Web Services William L. Oellermann Jr.
Apress, 2001
ISBN: 1893115585
Java Servlet API http://java.sun.com/products/servlethttp://java.sun.co
m/products/servlet/a
JavaServer Pages API http://java.sun.com/products/jsphttp://java.sun.com/p
roducts/jsp/a
Enterprise JavaBeans API http://java.sun.com/products/ejb/http://java.sun.com/
products/ejb//a
Java 2 Standard Edition API http://java.sun.com/j2se/http://java.sun.com/j2se//a
Servlet Source http://www.servletsource.comhttp://www.servletsourc
e.com/a
JSP Resource Index http://www.jspin.comhttp://www.jspin.com/a
Other resources xiii
Server Side http://www.theserverside.comhttp://www.theserversid
e.com/a
Dot Com Builder http://dcb.sun.comhttp://dcb.sun.com/a
Servlet Forum http://www.servletforum.com/http://www.servletforum
.com/a
xiv About This Book
Contacting Macromedia
Corporate
headquarters
Macromedia, Inc.
600 Townsend Street
San Francisco, CA 94103
Tel: 415.252.2000
Fax: 415.626.0554
Web:
http://www.macromedia.com www.macromedia.com/a
Technical support Macromedia offers a range of telephone and web-based
support options. Go to
http://www.macromedia.com/support/http://www.macromedia
.com/support//a for a complete description of technical
support services.
You can make postings to the JRun Support Forum
(http://webforums.macromedia.comhttp://webforums.macrom
edia.com/a) at any time.
Sales Toll Free: 888.939.2545
Te l: 6 17 . 2 1 9. 2 10 0
Fax: 617.219.2101
E-mail:
Web:
http://www.macromedia.com/store/http://www.macromedia.c
om/store//a
OEM/hosting sales For information about OEM/hosting, such as inquiries
regarding licensing and pricing for product, support, training
and consulting, contact:
Toll Free: 888.939.2545, request OEM Sales Desk extension
2157.
OEM Sales Desk: 617.219.2157
Fax: 617.219.2102
E-mail:
mailto:oemsales@macromedia.comoemsales@macromedia.c
om/a
Web:
http://www.macromedia.com/software/jrun/oemhttp://www.m
acromedia.com/software/jrun/oem/a
PART I
Introduction
This part contains an introduction to JRun and J2EE.
Welcome to JRun..........................................................................................................3
JRun Programming Model........................................................................................15
Introduction to J2EE..................................................................................................29
Using Servlets and JSP............................................................................................ 37
Introduction to EJB .....................................................................................................47
Developing Web Applications ................................................................................55
3
CHAPTER 1
Welcome to JRun
This chapter contains an overview of Macromedia JRun and JRun architecture. It
describes many of the features and tools that you use during application development
and deployment. It also includes a description of different types of JRun users and
pointers to the JRun documentation where each type of user can find additional
information.
Contents
About JRun ............................................................................................................. 4
J2EE standards compliance...................................................................................... 6
JRun architectural model......................................................................................... 7
JRun features........................................................................................................... 8
Development tools................................................................................................. 13
What to do next .................................................................................................... 14
4 Chapter 1 Welcome to JRun
About JRun
JRun is a complete Java application server for developing and deploying reliable, scalable,
and secure server-side Java 2 Enterprise Edition (J2EE) applications. JRun supports the
latest industry standards for developing applications composed of Java Servlets,
JavaServer pages (JSP), Enterprise JavaBeans (EJB), Java Message Service (JMS),
Macromedia Flash files, HTML pages, images, and other resources.
JRun supports a variety of Windows and UNIX platforms. Its open design lets JRun
work with a variety of existing web servers, including Apache, Microsoft Internet
Information Server (IIS), Netscape Enterprise Server (NES), Netscape iPlanet, and Zeus.
With JRun, you can deploy websites with dynamically generated content on almost any
platform.
JRun connects to a web server using a plug-in mechanism unique to each web server:
Netscape Server API (NSAPI) for Netscape, Internet Server API (ISAPI) for Microsoft
IIS, and the Apache 1.3 and 2.0 Dynamic Shared Object (DSO) interfaces for the
Apache web server. However, you do not need to have a separate web server to develop
and deploy applications using JRun. JRun provides its own built-in web server.
For more information, see Installing JRun.
Benefits of server-side Java
Java Servlets, JSPs, and EJBs are all examples of server-side Java—that is, Java code that
executes on an application server rather than on a web client.
Server-side Java has many important features that make it extremely useful for developing
web server applications, including the following:
Consistent Java features You can guarantee that your server supports the features
of Java that are required by your application.
Up-to-date Java technologies As the Java standard continues to evolve, your
server-side application can immediately take advantage of new Java features,
regardless of the compliance level of clients.
Control over the Java Virtual Machine (JVM) Your server runs the JVM that you
require for your application.
Server-side Java lets you completely realize the Javawrite once, run anywhere” goal. The
full capabilities of the language are available to you with no limitations or restrictions.
Because these applications run on the server, you can also control the platform, the
operating system, and every aspect of the environment in which your application runs.
With complete control over your environment, you can develop on one platform and
deploy on another with confidence that your application will run properly on both
platforms.
About JRun 5
Benefits of using J2EE
The J2EE platform represents a single standard for implementing and deploying
multitier, enterprise applications. J2EE applications take advantage of Javas inherent
portability and can be run on all platforms supported by JRun.
J2EE offers a number of benefits for application programmers, including the following:
Rich set of standard APIs and services
High performance
Integration with backend infrastructure, such as Relational Database Management
Systems (RDBMS) and Enterprise Information Systems (EIS)
Industry support, including third party tools and Application Programming
Interfaces (APIs)
JRun is standardized on the latest J2EE platform specifications, highlighted in the
following section.
6 Chapter 1 Welcome to JRun
J2EE standards compliance
Macromedia JRun is a J2EE-compliant application server. JRun passed the J2EE
Compatibility Test Suite (CTS) and delivers the full capabilities of the most recent Sun
J2EE 1.3 platform specification. The following table describes the many enhancements
and new features in the 1.3 specification:
Feature Description
EJB 2.0 Provides enhancements that simplify the development of distributed
components.
Container Managed Persistence (CMP) 2.0 lets developers build
portable applications that are database-independent and free of
database access code.
Introduces a standard, database-independent EJB query language
(EJBQL).
Introduces local interfaces to efficiently invoke an EJB component
residing on the same computer as the calling application.
Message Driven
Beans (MDB)
A part of the EJB 2.0 specification, combines the asynchronous
benefits of the Java Message Service (JMS) with EJB. MDBs are
message listeners that run in the EJB container and can use container
services, such as security and transactions.
J2EE Connector
Architecture
(JCA) 1.0
Defines a standard architecture that supports integration of J2EE
servers with enterprise information systems, such as Enterprise
Resource Planning (ERP) systems, mainframe transaction processing
systems, and legacy database systems.
JSP 1.2 Supports several additions to the JSP API, including the following:
Two new tag types, IterationTag and TryCatchFinallyTag.
An XML syntax for JSP pages (JSPX), which makes it easier to
automate the authoring of JSP pages.
A number of enhancements to Tag Library Descriptors (TLD) that
improve portability, and better support authoring tools.
Servlet 2.3 Introduces the following two important new features:
Application events Useful for application initialization code and
can replace preloaded servlets in some cases.
Filters Allow pre- and post-processing of servlet requests.
Java APIs for
XML Processing
(JAXP) 1.1
Supports the latest XML development features, including a pluggable
architecture for adding your choice of XML parser or XSL processor into
the server and overriding the default components that JRun includes.
Java Message
Service (JMS) 1.0
Lets J2EE application components create, send, receive, and read
messages. It enables distributed communication that is loosely coupled,
reliable, and asynchronous.
Java
Authentication
and Authorization
Service (JAAS)
Provides a way for a J2EE application to authenticate users and enforce
access controls in a modular fashion.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132

MACROMEDIA JRun 4 Getting Started Manual

Category
Software manuals
Type
Getting Started Manual
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI