
Example Servlets
Simple Servlet
This servlet outputs a very simple HTML page.
Try it,
Source
Snoop Servlet
A simple "echo" servlet, which displays the arguments it recieves.
Try it,
Source
Phone Servlet
This servlet loads a list of phone numbers from a
file specified as an intialization parameter. Upon
request, it will return a particular person's phone number if
their name is specified in the query string, otherwise it will
return the entire list.
Try it,
Source
Counter Servlet
This servlet uses cookies to maintain a persistant counter.
Try it,
Source
Fun Servlet
This servlet simply outputs an html page with an embeded
applet. To demonstrate basic authentication scheme, this servlet is
protected by an ACL (user jeeves and password jeeves).
Try it,
Source
Date Servlet
This servlet outputs the current date and time in plain text
format, suitable for embedding in an existing html document as
a server-side include.
Try it,
Server Side Include Example,
Source
Hello World Servlet
This is an another simple servlet which outputs a simple
html document. However, it is not loaded by default when
Jeeves starts up. To load it, go to the URL
http://<server>/admin.html
and give it the name "hello" and the class "HelloWorldServlet".
Then it may be accessed by the URL
http://<server>/servlet/hello
Try it,
Source
Finger Servlet
This servlet acts as a simple gateway for the finger protocol.