Servlets : Serving the Client from the Server Side


Java -- with Servlets -- facilitates elegant, single language solutions to programming on both the client and server side, and a means to communicate between the two, with the object-oriented features of Java.

Servlets let you communicate with with the Server to upload, store & retrieve files, process cookies, respond to web page forms, and otherwise free you from some of the constraints placed on stand alone applets.


java.sun.com ,   jserv.java.sun.com ,   developer.java.sun.com ,   sun.com ,   www.javaworld.com   are essential.

Tutorials, Texts introducing Servlets

Developing Java Servlets ,   Understanding Java Servlets   ( WebReview.com )

Sun's Servlet Tutorials :   Index ,   TOC ,   Servlet Tutorial / Java Web Server 1.1  ( 17 pages )
Sun's Resource List :       Developer Documentation / Java Web Server 1.1   ( like this, but different. )
Sun's list of off-site resources :   External Servlet Resources

Servlet Essentials   An excellent introduction with sample code  ( novocode.com )   by Stefan Zeiger

Replacing CGI Scripts with Servlets  ( Sun )

Servlets : Dynamic Web Pages in Java   ( Digital Cat's )   by Benoît Marchal.

JavaDoc : Java Web Server APIs   ( Sun )

Introduction to Servlets   ( Sun ) brief, too much so.

The Java Servlet API   overview / marketing perspective  ( Sun )

Developing Servlets with Java WorkShop   A White Paper   ( Sun )

The Complete CLASSPATH Guide for Servlets   ( Gene McKenna )

Servlets Tutorial   ( Java World )

The Java Servlet API   ( Sun )

CGI : Servlets vs. Perl   ( BYTE Magazine - June 1997 )

FAQ s

Servlets FAQ   ( Sun ) - Just 6 items ...
Servlet   FAQ   ( unofficial ), and short.   by Alex Chaffee
Java Programmer's FAQ   ( computer-lang/java/programmers/faq ) by Peter van der Linden   ( blushing ) links to here
comp.lang.java FAQ   ( computer-lang/java-faq/part1 ) by Elliotte Rusty Harold   ("Java Network Programming" author)
NOTE :   Last-modified: 1997/10/06
CGI Programming FAQ   not much Java yet ...   by Nick Kew

List of Java related FAQ s  ( Sun JDC )

Cookie & Posting RFC s   ( CGI Specifications )

RFC1867   Cookies ,   The Original Cookie Recipe   ( Netscape 1996 )
RFC2109   Posting Multi Part Forms

Demos, Examples, Source Code :   Hello World, Chat, Cookies & more ...

Servlet Demos   ( Sun )
Hello World ( The Java source code follows )  

  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;

			/** Hello World. This servlet simply says hi.  (c) 1997 Sun Inc. */

  public class HelloWorldServlet extends HttpServlet 
  {
	public void doGet(	HttpServletRequest	req,
	                  	HttpServletResponse	res 	) throws ServletException, IOException
	{
		                          res.setContentType( "text/html" );
		ServletOutputStream out = res.getOutputStream( );

		out.println( "<html>"                                       	);
		out.println( "  <head> <title> Hello World </title> </head> " 	);
		out.println( "     <body>"                        		);
		out.println( "                 <h1> Hello World </h1>"		);
		out.println( "    </body>"                         		);
		out.println( "</html>"                           			);
    	}	
  }						//____   end class  HelloWorldServlet   ____

Snoop 		( what the Server knows about the client ) Try it !
Cookie Counter
Phone 		( trivial database )
Protected Servlet
Date 
Certificate Authority (requires Navigator client)


FileUploadServlet.java ; FileUploadServlet.html ( for referance, servlet not hosted )

  Note :   SORRY !   For legal reasons I've purged the above source file of all useful information.

EasyChat Applet @ JavaWebServer.Com

  ( Chat servlet above works with Netscape only ! MiSE will hang if you try connecting. )

Duke's Bookstore example   ( includes a "Shopping cart" and a simple database ) :
  Source files : tut-bookstore.zip
  Tutorial     : The Example Servlets

Networking Examples   ( e-mail, newsgroup, sockets )   "Java How-To Networking"   ( geocities ) by Réal Gagnon

Resources ( Magazines, Companies, Major Sites )

Servlet For Me   A good directory.

Servlet Central

servlet.com

Servlet Hosting Services

  JavaWebServer.Com   ( $20 / month )
  BizNet Web Hosting Services   ( $20 / month )
  Electronaut's Hosting Services   ( $30 / month, $50 setup fee )
  Centralogic Corporation   ( $40 / month, $80 setup fee )

If you offer Servlet Hosting Services for less than   $40 / Month
let me know and I'll list you here. ( Tell me ! )

  Servlet Hosting Services   Comprehensive List of Hosting Services

Web Servers ( or extensions ) that support Servlets

Servers that support Servlets : 'Servlets Out In the World' ( Sun )




ACME Server   Free, with Source Code   by Jef Poskanzer

"This brilliant contribution to the Web emulates the Jeeves servlet API, runs servlets handily,
cooperates with version 1.1 of the Java Development Kit (JDK) ... Thanks, Jef!"   ( BYTE 1997 )


Servlet Magic : Netscape and Explorer clients talking to each other with Java Servlets.

The two clients, and the Web Server Administration Applet as they appear on my Windows95 machine.

It's neat that I could develop ( modify ) these on my Windows machine, but lacking a server on the internet severely constrains chatting...


On my Win95 system I start the Java Web Server by opening a DOS Window and typing :
| $  cd C:\Java\Servlets\Server\bin
| $  .\httpd   -javahome C:\Java\sdkBorland\java -verbose 

then to start the Admin applet I click on the MiSE icon and go to a bookmarked URL which is :

http://localhost:9090/index.html

and that's it !  The Server and Admin are both up and running.

My directory structure:

C:\Java			( all my Java )
C:\Java\sdkBorland	( JBuilder JDK 1.1 Compiler / SDK ( $99 ) )
C:\Java\Servlets		( my Servlets )
C:\Java\Sevelets\Server	( Sun's Java Web Server directory ( Free 30 day trial version ) )
C:\Java\Servlets\Server\bin\httpd.exe	( the Server program )
C:\Java\Servlets\Server\index.html	( Admin applet, aka http://localhost:9090/index.html )


Newsgroups, Mailing Lists, Discussion Groups

comp.lang.java.programmer   ( read @ DejaNews )
comp.lang.java.help   ( read @ DejaNews )   help for newbie java programmers
comp.infosystems.www.authoring.cgi   ( read @ DejaNews )   Java and ( mostly ) other CGI programming Q&A

Servlet Interest Mailing List   ( Sun )
Java Server ( JServ ) Mailing List  ( Sun )   more than fifty messages per day !   JServ Mailing List Archives   ( ! Sun )

Java Developers Discussion Group Click here, then   click on "toolbar", then "Discussion Groups"

  The Discussion Group ( below ) using Servlet / Browser / Applet networking.   Java is no toy !

Discussion Groups Applet for Java Developers


Books I like & recommend ( assuming you already know Java )

Java Network Programming ( O'Reilly )   Java Network Programming     by Elliotte Rusty Harold   ( from O'Reilly's excellent Java Series )
Grab & use their sample programs : javanetexamples.zip ( by ftp ) with their blessing ( O'Reilly )

Java Jump Start / Internet Programming   Java Jump Start     Guide to Internet Programming   by Noel Enete

Java Servlets   Java Servlets     by Karl Moss   ( I don't have this one, but it looks fairly good )


Servlet facilitated features I'd like to have are "Save / Retrieve / Send" functions for my "Build a Snowman" applet which is a feature I've had ( commercial and noncommercial ) requests to add.


The Compiler / SDK I Use

formerly Borland
 Standard Edition :   $ 100
 Pro ( Upgrade )  :   $ 250
 Pro ( Comp UG )  :   $ 300
 Pro ( New user)  :   $ 800
 Client / Server  : $ 2,000 (?)
Buy it Direct

I'm using the $99 Version 1.1 using Java 1.0.2.


This is a new and incomplete page.
[home.gif] Contents Page
Last modified: 09/08/98
First Created: 08/05/98
stamped envelope E- mail: "Webmaster"

Page location : http://www.frontiernet.net/~imaging/servlets_intro.html

Copyright © 1998 by Paul Flavin.   All rights reserved.