Java Servlets
This web page has information on Java Servlets.
Note: My hosting companies does not enable the use of Java Servlets.
To test any of the servlets I provide, you will need to have access to or install a Web Server and
Application Server on your local machine.
General Notes
 | What is a Java Servlet? - It is like an Applet (client side) that
runs on the server side that serves out HTML back to a browser via the Web
Server. Servlets are server and platform independent.
|
 | What do I need to compile a Java Servlet? You will need to
download the API (servlet.jar) and place it in the extensions directory of
the JDK. See the section below called "Install the JSDK".
|
 | What do I need to run a Servlet? You need one of the
following:
 | A servlet container for your web server: Apache Web Server, iPlanet
Web Server, Microsoft IIS, and others.
|
 | A servlet container for your web application server: BEA WebLogic
Application Server, IBM WebSphere, iPlanet Application Server, and
others.
|
 | Link
to Sun's list of other web server/web application servers and servlet/JSP
info.
|
 | I have a section below titled "Installation of Web Servers &
Application Servers" that may help you in setting up the necessary
environment on your local machine for training and testing.
|
|
Sun's Resources
Tutorials
Install the JSDK so you can Compile Java Servlets
 | I have a link above to Sun's Java Servlet home page. Download the
JSDK (Java Servlet Development Kit). In March of 01, there was a link
to "Java Servlet Specifications 2.2", then you download the final
version "class files" (30k) and "javadoc" (183k).
Notes on installing:
 | servlet-2_2b.zip - This file contains the servlet.jar file needed to
compile Java Servlets.
 | Extract the file servlet.jar. Then place the file in the JDK
extensions directory (ie: c:\jdk1.3\jre\lib\ext
).
|
 | Click here to download a hello world servlet so that you can
compile a servlet and test your install. Place the file "HelloWorldServlet.class"
in the appropriate servlet directory for your environment.
Usually a directory called "servlet" in the application
server's side.
|
 | Test your install by compiling a Java Servlet that you downloaded.
javac HelloWorld_Servlet.java
|
|
 | servlet-2_2b-doc.zip - This file is a zip of the javadocs for the
Servlet API's.
 | Extract, w/option to use folder names, to the "docs\api_servlet"
directory of your JDK. I could not figure out where SUN really
wants the files extracted to. If you extract them to the
"docs\api" directory, then you will not be able to access
the index for the regular API so I've created the "docs\api_servlet"
directory.
Example: c:\jdk1.3\docs\apiservlet
Warning: choose option "use folder names"
|
 | Note: The new zip file will create several new files in the
"api_servlet" directory and create a new directory called
"javax\servlet" and other subdirectories with many
files. Next you may want to setup a favorite link to the
index.html file in the new "api_servlet" directory.
|
|
 | servlet2_2-spec.pdf - PDF of the specifications. I had to
"send to, email" the pdf from SUN's site.
|
|
Installation of Web Servers & Application Servers
To be able to run Java servlets you need to setup a Web Server and an
Application Server.
 | WebSphere
& IBM HTTP Server - Installation notes for installing on a local
PC. At the end of the notes is a servlet test.
|
 | Microsoft Personal Web Server - Comes with Win98.
 | Insert you Windows 98 CD.
|
 | Click Start, Run.
|
 | Run: x:\add-ons\pws\setup.exe. (for "x", put the
drive letter of your CD).
|
 | Follow the directions.
|
|
|