Web Development with JavaServer Pages
JSP and Java 2 Enterprise Edition
JSP is now an integral part of developing web-based applications
using Java.
Because of its ability to separate presentation from implementation
logic by combining standard markup text with scripting elements and
object-oriented components,
JSP provides an excellent front-end technology for applications that
are
deployed over the web.
Java platform editions
In June 1999, Sun Microsystems announced that the Java 2 software
platform
would be split into three editions, aimed at different categories of
hardware deployment
platforms. The traditional Java Runtime Environment, or JRE, which
contains
all of the core classes in the formal language specification
(including, for
example, the standard networking, utility, and graphical user
interface classes), has
been renamed the Java 2 Standard Edition, or J2SE. The J2SE is
targeted toward
traditional desktop computing platforms, such as Microsoft Windows
and Apple
Macintosh personal computers.
A subset of the core classes, targeted toward handheld devices (for
example, PDAs-
personal digital assistants- such as the 3Com PalmPilot),
embedded processors
(such as Internet-enabled toasters), and so-called "information
appliances"
(e. g., digital TV set-top boxes), comprises the Java 2 Micro
Edition, or J2ME. The
goal of J2ME is to provide a Java environment with minimal footprint,
that nevertheless
supports the Java vision of Write Once, Run Anywhere™ program
code.
At the opposite extreme from J2ME is the Java 2 Enterprise
Edition, or J2EE.
Rather than subtract from the Java 2 core, as the micro edition does,
J2EE bundles
the core Java classes with extensions targeted toward enterprise
application development.
For example, J2EE includes support for Enterprise JavaBeans, which
provides
a set of standard abstractions for accessing corporate data stores,
such as databases
and directory servers, with automatic support for transaction
management and
resource pooling.
Given the inherent complexity involved in designing, constructing,
and maintaining
large-scale enterprise applications, however, Sun's specification of
J2EE
includes a set of guidelines for developing software using the J2EE
platform. These
guidelines take the form of a recommended base software architecture
referred to as
the J2EE Application Model.
Web-based applications
A key element of the J2EE Application Model is the use of the web as
a preferred
mechanism for data delivery between the application and the end user,
relying on
the web browser as a primary user interface for enterprise software.
The advantage
of this approach is that the web browser, in just the few short years
since the birth
of the World Wide Web, has been established as a ubiquitous,
cross-platform,de facto standard for accessing data over the network.
When an application relies on
the web browser for its user interface, there is no need for end
users to install any
additional software to run the application. And as new versions of
the application are
developed and deployed on the server, end users automatically start
using the new
version: end users need not take any local action to upgrade to the
latest version.
To facilitate web-based applications, then, both servlets and JSP are
required elements
of the J2EE specification. And while both technologies can be used to
dynamically generate HTML to be sent to an end user's web browser,
only JSP
enforces a strong separation between the presentation logic involved
in displaying
data and the business or programming logic used to generate that data
in the first
place. This separation means that the design of the user interface,
embodied in a set
of JSP pages, can be carried out independently from the design of the
other code
that runs on the server (e. g., interpreting requests, formulating
database queries,
and manipulating results). This independence leads to much more
robust applications,
since changes to one part of the application generally do not require
corresponding
changes to other parts. Specifically, when using JSP, changes to the
presentation of the data (e. g., formatting of the data, design of
the associated
graphics, overall page layout) do not require any changes to the
underlying server
code that supplied that data in the first place.
Given Sun's selection of servlets and JSPs as major components of
J2EE, it is
clear that support for these technologies will continue to grow. Even
now, it is more
the rule than the exception that enterprise web application servers,
such as Netscape
Application Server, IBM WebSphere, and BEA WebLogic, include support
for both
servlets and JSPs.
In addition to growth in the market for software to deploy JSP, it is
anticipated
that improved development tools will soon be available. Currently,
JSP development
is essentially a manual process, but several of the web authoring
tool vendors have
announced support for JavaServer Pages in upcoming releases of their
products,
including Drumbeat 2000 from Macromedia, IBM's Visual Age for Java,
and
HomeSite from Allaire. JSP's built-in support for component-based
design using
JavaBeans, discussed in a later section, promises to enable a new set
of tools for creating
dynamic web pages graphically, using a visual programming approach to
drag
and drop server-side Java components into WYSIWYG editing tools. The
ability to
create sophisticated JSP pages without ever seeing HTML tags, let
alone Java code,
may soon be a reality.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.