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.
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
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.
Detailed product information on JRun and
related topics.
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.
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.
Professional support programs that
Macromedia offers.
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
viii About This Book
Connection with the growing network of
solution providers, application developers,
resellers, and hosting services creating
solutions with JRun.
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:
BookDescription
Installing JRunDescribes installing and configuring JRun.
Getting Started with JRunProvides a J2EE overview, concepts, and tutorials for
JSPs, servlets, EJBs, and web services.
JRun Administrator’s GuideDescribes how to integrate a JRun server into an
existing environment.
JRun Programmer’s GuideDescribes how to use JRun to develop JSPs, servlets,
custom tags, EJBs, and web services.
JRun Assembly and Deployment
Guide
JRun SDK GuideProvides information to OEM/ISV customers and
JRun Quick ReferenceProvides brief descriptions and syntax for JavaServer
Online HelpProvides JMC users with usage notes, procedures, and
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.
Describes how to assemble and deploy the
components of a J2EE application.
advanced users who embed, customize, or use the
APIs in JRun.
Pages (JSP) directives, actions, and scripting elements.
concepts.
About JRun documentationix
Other resources
You can consult the following resources for more information on topics described in
JRun documentation.
Introduction to J2EE..................................................................................................29
Using Servlets and JSP............................................................................................ 37
Introduction to EJB .....................................................................................................47
Developing Web Applications ................................................................................55
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.
•What to do next .................................................................................................... 14
3
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 featuresYou can guarantee that your server supports the features
of Java that are required by your application.
•Up-to-date Java technologiesAs 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 Java “write 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.
4Chapter 1 Welcome to JRun
Benefits of using J2EE
The J2EE platform represents a single standard for implementing and deploying
multitier, enterprise applications. J2EE applications take advantage of Java’s 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.
About JRun5
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:
FeatureDescription
EJB 2.0Provides enhancements that simplify the development of distributed
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)
J2EE Connector
Architecture
(JCA) 1.0
JSP 1.2Supports several additions to the JSP API, including the following:
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.
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.
• 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.3Introduces the following two important new features:
• Application eventsUseful for application initialization code and
can replace preloaded servlets in some cases.
• FiltersAllow 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
Java
Authentication
and Authorization
Service (JAAS)
6Chapter 1 Welcome to JRun
Lets J2EE application components create, send, receive, and read
messages. It enables distributed communication that is loosely coupled,
reliable, and asynchronous.
Provides a way for a J2EE application to authenticate users and enforce
access controls in a modular fashion.
For detailed information on the J2EE platform, see Chapter 3, “Introduction to J2EE”
on page 29.
JRun architectural model
JRun has a service-based architecture, a modular design that contains pluggable services
(components) in a core server backbone.
The server backbone facilitates communication among all components or services that
plug into it. It provides a core set of services that are shared across all the components and
features of the server. The backbone provides flexibility through its ability to
accommodate various services. Services extend the core server by adding functionality,
independently of each other.
In JRun, the core server backbone is the server kernel. The services are JRun server
features, as the following figure shows:
The JRun architecture is based on Java standards, including the following:
•Java Management Extensions (JMX)Specifications for managing Java
environments. JMX defines the architecture and APIs for a scalable system that you
can integrate with existing management systems.
•Java Naming & Directory Interface (JNDI)A standard mechanism for Java-based
applications to access application components and server resources across a
distributed computing environment.
•XMLAn open, cross-platform formatting standard used for storing information
about the state of a JRun service.
JRun is built on a JMX service-based architecture, and uses JMX to provide flexible and
dynamic management and administration. JMX is an emerging Java standard for
management and customization.
JRun implements its features and functionality (for example, EJB container, web
container, and logging) as JMX services (called MBeans), plugged into the JRun kernel.
You can manage these services through the JMX-enabled JRun Management Console
(JMC) or other JMX-enabled management tools.
JRun architectural model7
Because services are independent of each other and can be restarted individually, the
JRun service-based architecture ensures high application availability. It also provides a
highly customizable and easily extensible platform. You can unplug unneeded services to
avoid the overhead of unused functionality. Administrators, advanced developers, and
Original Equipment Manufacturers (OEMs) can also create their own custom services
(MBeans) and plug them into the JRun kernel. All JRun services can take advantage of
the clustering capabilities built into the JRun kernel.
For more information on JRun architecture, see JRun Administrator’s Guide.
JRun features
JRun 4 provides many new and changed features, including the following:
•Dynamic deployment of J2EE components
•Dynamic servlet and class reloading and compilation
•Dynamic creation of database tables for entity beans
•JRun Server Tags (JST)
•JRun Management Console (JMC)
•Web Server Configuration tool
•Clustering
•Security
•Enterprise Deployment Wizard
•XDoclet integration
•Pointbase database server
•JDBC Drivers
•Sample applications
•Web services
Dynamic deployment of J2EE components
JRun provides auto deploy and hot deploy features for dynamic deployment of web
applications, EJBs, enterprise applications, and enterprise resource adapters from Java
archive files or expanded directories. When you copy a J2EE module archive file or
directory to a deploy directory (jrun_root/servers/jrun_server, by default), JRun
automatically deploys the module in a running server or deploys it the next time the
server starts. The deployment is dynamically updated when you modify a module archive
file or deployment descriptor. For more information, see JRun Assembly and Deployment Guide.
Dynamic servlet and class reloading and compilation
You can configure JRun to dynamically recompile and reload servlets, JSPs, servlet helper
classes, and JSP helper classes when a servlet or JSP is called. When the compile and
reload features are enabled, JRun dynamically recompiles and reloads a servlet when it is
called. JRun also dynamically recompiles and reloads classes in the WEB-INF/classes
directory, and tag library classes when they are called by a servlet or JSP. This feature is
disabled by default.
8Chapter 1 Welcome to JRun
You enable dynamic compiling and reloading by creating a WEB-INF/jrun-web.xml file
that contains the following text, setting the reload and compile values to false or true:
For more information, see JRun Assembly and Deployment Guide.
Dynamic creation of database tables for entity beans
When you deploy an entity bean, and its required database tables do not yet exist, JRun
can generate them for you when you have configured the appropriate Java Database
Connectivity (JDBC) data source in JRun. For more information, see JRun Programmer’s Guide.
JRun Server Tags (JST)
JST technology supports JSP 1.2 and recursion. JST lets you write custom JSP tags using
JSP syntax, rather than the custom tag handler API. Recursion allows a JST to call itself.
JRun Management Console (JMC)
The redesigned, JMX-enabled JMC provides an easy-to-use, intuitive graphical user
interface for managing your local and remote JRun servers. Using the JMC, you can
create servers, define clusters, manage applications, and implement security based on
JAAS. For additional information, see the JMC online Help.
Web Server Configuration tool
JRun provides native connectors for most major web servers. Using the Web Server
Configuration tool, you can connect one or more web servers to each JRun server. The
Web Server Configuration tool, a stand-alone tool, does not require JRun on the web
server host. For information on connecting JRun to an external web server, see Installing
JRun. For more information on understanding web server connectors, see JRun
Administrator’s Guide.
Clustering
JRun provides enterprise-level server clustering for maximum reliability and scalability.
Clustering is built into the web server connectors and the JRun kernel:
•At the web server connector level, clustering enables load balancing and automatic
failover between the web server and the web containers. In-memory session
replication ensures that state information is preserved if the web server fails over to
another web container in the cluster.
•At the kernel level, clustering enables load balancing and automatic failover for
clusterable server objects, such as EJBs, JNDI trees, or any clusterable custom service.
The object state (for example, the state of a stateful EJB) is automatically replicated in
an optimized manner to provide the highest level of reliability while maintaining
performance. JRun servers use the JINI technology to dynamically locate their peers
JRun features9
Security
in the cluster, eliminating the risk inherent to a single point of failure. For more
information, see JRun Administrator’s Guide.
JRun supports the JAAS 1.0 specification, which includes the following levels of security:
•JRun administration securityJRun uses JAAS as the security framework. JAAS is
a set of packages that lets JRun authenticate users and enforce access controls in a
modular fashion. The default JAAS security module provides an XML-based security
management (jrun-users.xml). JAAS provides a pluggable mechanism that lets you
customize the system to integrate with existing authentication user stores, such as
LDAP or a relational database. In addition, you can write custom security modules
based on the JAAS specification.
JRun includes a JDBC-based login module and an LDAP-based login module, which
perform authentication and authorization using information stored in a relational
database or an LDAP directory. JRun also supplies a login module for users and
groups from Windows domains. For more information, see JRun Administrator’s Guide or the JMC online Help.
•Web application securityTo address security issues that involve web applications,
the Java Servlet API specification defines an authentication mechanism to control
client access to resources within a web application. Web application security
guarantees that only authorized web clients have access to the resources on a website.
For more information on web application security, see JRun Administrator’s Guide.
•EJB securityJRun provides a configurable mechanism for implementing EJB
security, as defined in the EJB specification. In the deployment descriptor, you specify
the users or roles allowed to access each bean method. You can specify the type and
content of user information to be verified, what composes a role, and how
authentication occurs. This flexibility can accommodate security schemes that you
might already have in place. For more information on EJB security, see JRun Administrator’s Guide.
Enterprise Deployment Wizard
JRun includes the Enterprise Deployment Wizard for developing, packaging, and
deploying EJBs. Using its Swing-based graphical user interface, you can create any type of
EJB, or edit the deployment descriptor of existing EJBs, package them into JAR files, and
deploy them on JRun. In particular, the object-relational mapping capabilities of the
Enterprise Deployment Wizard let you streamline the entity bean development process.
The Enterprise Deployment Wizard runs as a stand-alone tool, or as a plug-in on top of
an Java Integrated Development Environment (IDE).
To start the Enterprise Deployment Wizard, run jrun_root/bin/jrunwizard.exe
(Windows) or jrun_root/bin/jrunwizard (UNIX).
To install the Enterprise Deployment Wizard in an IDE, open a console window to the
jrun_root/lib directory and issue the following command:
java -jar jrunwizard-installer.jar
For a list of currently supported IDEs, see the Release Notes.
10Chapter 1 Welcome to JRun
The Enterprise Deployment Wizard features a context-sensitive online Help system. For
usage information, see the online Help.
XDoclet integration
JRun provides integration with XDoclet, a popular open-source Java utility that greatly
simplifies the development of J2EE modules (such as EJBs, servlets, and custom tags) by
letting you maintain your component metadata using Javadoc-style tags in a single source
file.
For example, to create an EJB, you traditionally have to maintain four different files: the
home interface, the remote or local interface, the implementation class, and the
deployment descriptor. Using XDoclet, you only maintain a single source file (the
implementation class) that you annotate with special Javadoc tags, that indicate how the
auxiliary files should be built. JRun senses modifications to the source file and
automatically builds the auxiliary files (such as interfaces and deployment descriptors).
For more information, see JRun Programmer’s Guide.
Pointbase database server
JRun includes a restricted version of the PointBase Server Database Management
Software (DBMS). This is an all-Java database used with the JRun sample applications.
You can use this database server for your evaluation and development work. For more
information on the PointBase database, see the PointBase documentation, located in
jrun_root/pointbase/docs. (jrun_root is the directory into which you installed JRun.)
JDBC Drivers
JRun embeds type 4 JDBC database drivers that provide connectivity to all major
databases.
Sample applications
The samples JRun server contains a variety of applications that illustrate a number of
coding techniques. The following table describes the samples applications that are
included with JRun:
ApplicationDescription
Compass travelA simple online travel agent trip reservation system. This
TravelNetAn online travel agent that sells trips from Compass travel. This
application illustrates JSP, servlet, and EJB programming and is
delivered as an enterprise application in an open-directory
structure. Compass travel uses the compass database, accessing
it through the compass data source, which you can view through
the JMC. For companion tutorial lessons, see Part II, Tutorials.
application illustrates JSP and web services programming, and is
delivered as an enterprise application in an open-directory
structure. For companion tutorial lessons, see Lesson 4, “Web
Services Tutorial” on page 97.
JRun features11
ApplicationDescription
World musicAn e-commerce application that sells music. This application also
contains an admin module. The world music application illustrates
many common design patterns using JSP, servlet, and JavaBean
programming. The world music sample application uses the
worldmusic database, accessing it directly through JDBC.
Web servicesProgramming techniques used in JRun web services
programming.
Web services
Programming
techniques
Flash gatewayFlash movies and Flash Gateway adapters, which illustrate how to
SmarTicketA Java Blueprints J2ME application. The SmarTicket application
Java PetStoreA Java Blueprints J2EE application that shows how to use the
Programming techniques described in this book. The techniques
application uses the samples database, accessing it through the
samples data source, which you can view through the JMC.
write Flash applications that communicate with JRun.
illustrates how the J2EE platform interoperates with the Java 2
Micro Edition (J2ME) platform to create enterprise applications
that serve mobile client devices, such as cell phones, two-way
pagers, and palmtops.
The SmarTicket application uses the smarticket database,
accessing it through the smarticket data source, which you can
view through the JMC.
capabilities of the J2EE 1.3 platform to develop a typical
e-commerce application, which can take and process orders and
credit card information, manage user logins, shipping information,
and shopping cart sessions.
JRun lets you publish and consume web services. Web services provide platform- and
location-independent computing using XML and standard Internet protocols such as
HTTP. By allowing previously incompatible applications to interoperate over the web,
regardless of language, platform, or operating system, web services create new business
opportunities and help companies adapt to changing business relationships. For example,
a Microsoft .NET component can communicate with a J2EE component, such as an
Enterprise JavaBean (EJB).
Using JRun, you can reuse existing Java code as a web service, or write new code
specifically to publish as a web service. You also can create object- and tag-based clients
that can invoke methods on remote web services, even when those services reside on
non-Java platforms.
The JRun web services implementation is built on Apache Axis, the third generation of
the Apache Software Foundation’s Simple Object Access Protocol (SOAP) engine. For
more information, see JRun Programmer’s Guide.
For more information on JRun 4 features, see the Release Notes in jrun_root/
relnotes.htm.
12Chapter 1 Welcome to JRun
Development tools
Macromedia provides development tools (available separately) to work with JRun.
Additionally, you can use JRun with your Java IDE.
Dreamweaver MX
Dreamweaver MX is an HTML editor for visually designing and managing websites and
JSPs created with JRun. Dreamweaver MX increases JSP developer productivity with the
following coding tools and features:
•Visual programmingAccelerate development with powerful two-way visual
programming tools integrated with transparent source editing.
•HTML design Includes all the functionality of Macromedia HomeSite, the
award-winning HTML design tool.
•JavaScript Debugger
•Code editors Code view and Code inspector that let you edit JavaScript, XML,
and other text documents.
Using JRun with your Java IDE
You can fully integrate JRun with your Java IDE. When setting up your IDE to work
with JRun, you specify the following:
•The class containing the JRun server main method: jrunx.kernel.JRun, contained
in jrun_root/lib/jrun.jar
Note: The jrun_root directory is the directory into which you installed JRun.
•The working directory: jrun_root/bin
•The JAR files needed in the JRun runtime classpath: All the JAR files located in
jrun_root/lib and jrun_root/servers/lib
Note: The JRun JDBC drivers are included in the jrun_root/lib/jrun.jar file and require no
special attention.
•The command-line arguments passed to the JRun server main method:
start [jrun_server]
Note: Before starting JRun inside your IDE, stop the JRun server on your computer.
Otherwise, port conflicts arise with the running server, and JRun will not start inside your
IDE.
Installing the Enterprise Deployment Wizard in your Java IDE
To install the Enterprise Deployment Wizard in an IDE, open a console window to the
jrun_root/lib directory and issue the following command:
java -jar jrunwizard-installer.jar
For a list of currently supported IDEs, see the Release Notes.
The Enterprise Deployment Wizard features a context-sensitive online Help system. For
usage information, see the online Help.
Development tools13
What to do next
The remaining chapters in Part I provide a general introduction to JRun and J2EE.
These chapters include the following:
•Chapter 2, “JRun Programming Model” on page 15
•Chapter 3, “Introduction to J2EE” on page 29
•Chapter 4, “Using Servlets and JSP” on page 37
•Chapter 5, “Introduction to EJB” on page 47
•Chapter 6, “Developing Web Applications” on page 55
All JRun users should be familiar with the information in these chapters.
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. You learn how to combine these elements to produce a flexible and scalable
J2EE application. In the last tutorial lesson, you use web services to access data in a JRun
sample application.
The following table shows the books to read after the introductory chapters, depending
on your role in developing and deploying JRun applications:
RoleDescriptionFor more information
All JRun developersPerforms common development tasks
including application monitoring,
debugging, and authentication.
System administrator Responsible for installing and
administrating JRun in a production
environment, starting and stopping
JRun, and adding and removing
applications.
JSP developerCreates JSPs that generate dynamic
content that is returned to clients.
These JSPs can reference Java
Servlets, custom tag libraries, or
JavaBeans.
Java Servlet and tag
library developer
EJB developerCreates reusable components used by
Application deployerPackages JRun applications for
Develops servlets in Java, and also
develops custom tag libraries used in
JSPs.
Java Servlet and JSP developers.
deployment or resale.
JRun Administrator’s Guide
JRun Administrator’s Guide
JRun Programmer’s Guide
JRun Programmer’s Guide
JRun Programmer’s Guide
JRun Assembly and
Deployment Guide
14Chapter 1 Welcome to JRun
CHAPTER 2
JRun Programming Model
JRun is a complete Java application server for developing and deploying J2EE enterprise
applications. This chapter describes the JRun programming model, the major
components of JRun, and JRun support for J2EE enterprise applications.
•JRun support for J2EE applications ....................................................................... 26
15
Enterprise application architecture
The standards for enterprise application development on the web are based on the J2EE
specification. JRun supports the J2EE application model and provides a runtime
environment for executing enterprise applications.
Enterprise application design
Enterprise applications share several common design goals, including the following:
•Extensibility and maintainabilityIt should be easy to add and maintain new
functionality.
•Scalability, portability, and availabilityMany enterprise applications must scale to
support thousands of users. A portable application reduces the risk of vendor lock-in
and system obsolescence. High availability ensures uninterrupted access to enterprise
data and business functions.
•Code reuseCode developed for an application must be reusable within the
application and, ideally, in other applications as well.
•InteroperabilityAn enterprise application must be able to interoperate with other
systems, using their services and providing services to them, particularly existing
information assets, including legacy systems.
•Focus on implementing business logicDevelopers must focus on writing code to
address business issues and minimize time spent dealing with system mechanisms.
For more information on application design patterns, see JRun Programmer’s Guide.
Dividing an enterprise application into tiers supports an enterprise application’s design
goals with layers that separate differing design and implementation concerns, such as
information persistence, application functionality, and user interaction. The next section
explains the roles of the tiers in a J2EE application and describes the technologies
available in each tier.
For more information on J2EE, see Chapter 3, “Introduction to J2EE” on page 29.
J2EE application architecture
By definition, J2EE applications are multitiered. Each tier brings specific benefits to the
application design. A tiered architecture provides natural access points for integration
with existing and future systems. J2EE applications divide their functionality across
several tiers or functional layers, each of which serves a specific purpose. This model
divides the functionality of a business website into discrete components that can be
implemented independently from each other. Typically, multitier applications have the
following characteristics:
•Client tierUser interaction and data capture occur in the client tier. Client tier
programs translate user actions and input into server requests, and format server
responses; for example, using a browser to access the middle tier over an HTTP
connection, such as the Internet. Included in this tier are any applets that execute on
the client’s machine.
16Chapter 2 JRun Programming Model
Loading...
+ 102 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.