Mailing List Archive

Re: Java and Web servers (fwd)
---------- Forwarded message ----------
Date: Mon, 17 Jul 1995 11:19:31 +0200
From: Anselm.BairdSmith <Anselm.Baird_Smith@inria.fr>
To: hotjava-interest@java.sun.com
Subject: Re: Java and Web servers


I am working on a (prototype) java based httpd server, that allows for
dynamically loadable "servlets" ;-). The configuration file looks
like:

"/cgi/\\(.*\\)" HttpCgiObject ()
"/protected/\\(.*\\)" HttpAccessFilter ("realm", HttpFileObject ())
"/inria/\\(.*\\)" HttpRedirectObject ("http://www.inria.fr/")
"/forms/\\(.*\\)" HttpPostObject ()
"/\\(.*\\)" HttpFileObject ()

The idea is that the left hand side term is a regular expression to be
matched against the requested URI. When some match occurs, the right
hand side objects are instantiated (or fetched from a cache), and
"handle" the request. Line 2 says (for example) that all URI matching
/protected/* are filtered through a security checker (which implements
the HTTP/1.0 Basic authentication scheme), and than forwarded to a
"normal" FileObject.

"Handlers" derive from base class HttpObject which begins with:

public class HttpObject {
abstract void get (HttpServer client, HttpRequest request) ;
abstract void put (HttpServer client, HttpRequest request) ;
abstract void post (HttpServer client, HttpRequest request) ;
abstract void delete (HttpServer client, HttpRequest request) ;
abstract void link (HttpServer client, HttpRequest request) ;
abstract void unlink (HttpServer client, HttpRequest request) ;
abstract void head (HttpServer client, HttpRequest request) ;
abstract void extended (HttpServer client, HttpRequest request) ;

...
}

I don't know whether this is a good idea, although I believed it some
times ago. My topmost fears are:

a) the server always grows, but never shrinks (this seems to be the
same for hotjava, as it also loads one class per applet, which seems
to be never GCed)
b) configuration may quickly become a nightmare
c) speed

Any comments on this approach welcome, of course !

Anselm.

Anselm.BairdSmith@inria.fr - http://www.inria.fr/koala/abaird.html


-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to hotjava-interest-request@java.sun.com