logo_michael-thomas.jpg (3143 bytes)

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

bulletWhat 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.
bulletWhat 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".
bulletWhat do I need to run a Servlet?  You need one of the following:
bulletA servlet container for your web server: Apache Web Server, iPlanet Web Server, Microsoft IIS, and others.
bulletA servlet container for your web application server: BEA WebLogic Application Server, IBM WebSphere, iPlanet Application Server, and others.
bulletLink to Sun's list of other web server/web application servers and servlet/JSP info.
bulletI 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

bullethttp://java.sun.com/products/servlet/index.html - Sun's Java Servlet home page.  There is also links to TomCat@Jakarta which is Apache's implementation of Java Servlet and Java Server Pages.
bulletArchives: http://archives.java.sun.com/archives/servlet-interest.html
bulletResources: http://java.sun.com/products/servlet/external-resources.html
bulletLISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Tutorials

bullethttp://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/ 

Install the JSDK so you can Compile Java Servlets

bulletI 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:
bulletservlet-2_2b.zip - This file contains the servlet.jar file needed to compile Java Servlets.
bulletExtract the file servlet.jar.  Then place the file in the JDK extensions directory (ie: c:\jdk1.3\jre\lib\ext ).
bulletClick 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.
bulletTest your install by compiling a Java Servlet that you downloaded.
javac HelloWorld_Servlet.java
bulletservlet-2_2b-doc.zip - This file is a zip of the javadocs for the Servlet API's.
bulletExtract, 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"
bulletNote:  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.
bulletservlet2_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.

bulletWebSphere & IBM HTTP Server - Installation notes for installing on a local PC.  At the end of the notes is a servlet test.
bulletMicrosoft Personal Web Server - Comes with Win98.
bulletInsert you Windows 98 CD.
bulletClick Start, Run.
bulletRun:  x:\add-ons\pws\setup.exe.  (for "x", put the drive letter of your CD).
bulletFollow the directions.