Web Development with JavaServer Pages
JavaServer Pages
As discussed earlier, incorporating dynamic content must ultimately
involve some
form of programming to describe how that content is generated.
Program code,
however, tends to be expensive to create and to maintain, so
minimizing the need
for programming is often a desirable goal. Combining this goal with
Sun's objective
for robust, full-featured support for Java on the server, a
Java-based template system, JSP,
was the natural result.
JSP is something of a hybrid among template systems, because it
supports two
different styles for adding dynamic content to web pages. Like ASP,
SSJS, and PHP,
scripts can be embedded in JSP pages containing actual programming
code. In the
case of JSP, this programming code is typically Java. (Actually, the
JSP specification
allows for the possibility of alternative scripting languages. See
chapter 3, "Programming JSP
scripts," for details.) Like ColdFusion, JSP supports a set of
HTML-like
tags that interact with Java objects on the server, without the need
for raw Java
code to appear in the page. In fact, the JSP 1. 1 specification takes
this capability a step further, by providing a tag extension mechanism that allows
developers to create
libraries of custom tags that can be loaded into a JSP page. These
custom tags
can then be used on the page just like the standard JSP tags.
NOTE As a demonstration of the power of this approach, it
is interesting to note
that Live Software, makers of the JRun servlet software, have
developed a set of custom JSP tags which reproduce the tags used in
Allaire's ColdFusion
product. This product, effectively a cross-platform, Java-based
clone of Cold-Fusion, was released in May 1999 as <CF_
Anywhere>. Allaire was sufficiently
impressed by this feat that in June 1999, it bought the company.
Servlets and JavaServer Pages first appeared as part of Sun's Java
Web Server
product, an HTTP server written in Java. Sun eventually released the
servlet technology
as a standard Java extension. JSP soon followed, with the first draft
API specifications
appearing in 1998. The JavaServer Pages 1. 0 Specification was
released in June
1999, thus ensuring a stable, well-defined platform for vendors to
build against.
Soon after Sun published the Java servlet specification, other
companies began
to add support for the base servlet architecture to their products.
Since JSP
functionality itself is typically implemented using the servlet
technology, other Servlet
products could readily take advantage of it, and web developers
quickly discovered
its advantages.
As such, a number of third-party products are now available for
adding servlet
and JSP functionality to existing web servers. Two of the more
popular products in
this category are JRun from Live Software and New Atlanta's
ServletExec. In addition,
in June 1999 Sun Microsystems and the Apache Software Foundation
announced the Jakarta Project, the goal of which is an Open Source
implementation
of servlets and JSP that will also serve as one of the reference
platforms for
these technologies.
As an essential element of feature-rich web sites and web-based
applications,
dynamic content generation continues to be the focus of much
attention in the web
development community. JSP is now positioned to play a major role in
the ongoing
evolution of web technology, and we look forward to seeing the next
generation of
online tools, services, and diversions that will be enabled by
JavaServer Pages.
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.
|