Dynamic HTML Document Generation and Java Servlets
HTML is static.
Many have tried to give life to HTML. Now we will look at some
of the solutions that have been offered to keep HTML alive for just a little
longer. These solutions include CGI, Microsoft Active Server Pages, and
Java Servlets.
Common Gateway Interface (CGI)
In the beginning there was CGI. Written typically in Perl CGI programs/scripts
have been the norm for user-web server interaction with external applications
which may include databases. CGI programs/scripts allow for real time generation
of HTML documents which contain information that may be changed dynamically
to fit the needs of a given task. CGI programs/scripts may act as an interface
(or gateway) to a database or other application. CGI programs/scripts
have been used for a log time and are proven to work. CGI programs/scripts
can be written in any language that can be executed on the local system.
Examples of languages used for CGI include C/C++, Perl, TCL, shell scripts,
and Visual Basic.
Advantages of CGI:
-
Proven method used for many years.
-
All platforms supported.
-
Variety of languages supported.
Disadvantages relating to CGI programs/scripts include:
-
Each CGI program/script runs in separate processes. Highly visited web
servers may have resource problems.
-
CGI program (binary) may not be used platform to platform without modification
to the source and re-compilation.
-
CGI programs/scripts are difficult to write and main.
-
A CGI program written in one language may not have a implementation on
a different platform.
Links for more information concerning CGI:
CGI Definition at NCSA
Yahoo's
Listing on CGI
CGI Spec at
NCSA
Active Server Pages
Active Server Pages by Microsoft allow easy integration of JavaScript,
VB Script, and SQL Sever Databases and other Databases using ODBC. Active
Server components in the form of Microsoft's Component Object Model (COM)
components may contain business logic relating to a task that needs to
be performed. These COM objects will perform tasks set aside for a middle
tier application such as communicating user data to and from a database.
Active Server Page components may be extended through use of COM Objects.
Advantages to Using Active Server Pages:
-
Code Reuse through COM
-
Easy communication with Java Script and VB Script
-
Easy communication with SQL and standard ODBC link
Disadvantages of using Active Server Pages:
-
The main disadvantage of Active Server Pages is platform portability.
-
Developers will need to learn another programming language.
-
Active Server Pages depends on Microsoft Internet Information Server 2.0
which supports the Active Platform. This application is with Windows NT.
-
With Active Server Pages you are bound to the Windows platform.
Links to more information:
Active Server Pages .com
Active Server Pages 101
An
Introduction to Web-Based Application Development
ASP Developers Network
Java Servlets
Java Servlets are an easy means of creating dynamic content which will
output in HTML. Compared with the alternatives which I will also include
Java Applets Java Servlets provide a good set of advantages.
Advantages of using Java Servlets include:
-
Java Servlets may perform complicated middle tier level tasks without the
"sand box" limitations that exist with Java Applets.
-
Java Servlets are run on the server and may perform any task needed.
-
Java Servlets do not depend on what version of Java a browser uses or even
whether or not the browser supports Java.
-
Java Servlets are written in Java and are extensible. Java Servlets are
Platform independent (when written using pure java). Java Servlets
byte code should be usable across platforms without changes.
-
Java Servlets are capable of using less resources. A single thread is needed
per Servlets versus a process in CGI.
-
Java Servlets are written in Java which allows developers familiar with
Java to start developing write away.
-
JDBC may be used to communicate with databases which allows a wide variety
of data bases to be supported.
Web Servers that support Java Servlets include:
-
Acme Acme.Serve
-
Apache Web Server
-
ATG Dynamo Application Server
-
IBM Internet Connection Server
-
IBM VisualAge WebRunner Toolkit
-
Java Web Server
-
jo!
-
KonaSoft Enterprise Server
-
Live Softeware JRun
-
Lotus Domino Go Webserver
-
Mort Bay Jetty
-
Novocode NetForge
-
Paralogic WebCore
-
ServletFactory
-
Sun Web Server
-
Tandem iTP WebServer
-
W3C Jigsaw
-
WebEasy WEASEL
-
WebLogic Tengah Application Server
-
Zeus Web Server
Other Webservers that support Java Servlets through Add ons include:
-
Gefion Software WAICoolRunner
-
IBM WebSphere Application Server
-
Live Software JRun
-
New Atlanta Communications ServletExec
-
Unicom Servlet CGI Development Kit
Disadvantages of using Java Servlets:
-
Developers will need to learn Java
-
Web Administrator will need to learn how to install and maintain Java Servlets.
Links relating to Java Servlets:
Java Servlet
API
JavaWorld
12/98 Feature Articles on Java Serlvets
The Word
Spreads: Devlopers Abandon CGI in Favor of Servlets
Conclusions:
HTML is not dead (yet). Until other technologies fully replace HTML as
a standard medium for display on the internet and intranet of the world
we will need to deal with solutions based in HTML. HTML need not be static.
Through the use of technologies such as CGI, Active Server Pages, and Java
Servlets a new dimension may be added to HTML.
Platform and web server support for Java Servlets along with extensibility
and resource utilization make Java Servlets the best choice for generating
dynamic documents.