A servlet is a program that runs on a web server and which
dynamically generates webpages. It often will use data submitted
by the user on HTML forms to generate the new webpage, and it
may also access a database and/or send email while storing the data.
All of the servlets we will examine in this class have a URL
of the following form:
http://tat.cs.brandeis.edu:8080/user/Cosi2a/USERNAME/FILENAME.sxml
where the extension "sxml" tells the server that this is a servlet.
Forms and parameters
Here are some examples of simple servlets, together with the
html code for invoking them:
bounce
This servlet just shows you the values of the parameters you have sent.
It is useful when designing forms.
the date servlet
Clicking on
this hyperlink
causes the servlet to generate
a webpage containing the current time!
Clicking on
this hyperlink
causes the servlet to generate
a webpage containing the current time!
The code for the date servlet is
Date
It is now (Date.)
Notice the use of the <scheme> tag
to include some scheme code in the HTML.
SXML: a language for writing servlets
In this class, we will use the SXML dialect of Scheme to
create servlets. The simplest form of such a program will be
the following