You are to write several files, the main one being, q3.servlet. This servlet includes code that check to see if the person is logged in and also if so logs their visit to the page in a database table along with the time. It also shows how many times the person has visited this page.
Here are all the files you need to create
q3login.html This generates a form asking for a loginid and sends the data to q3dologin.servlet
q3dologin.servlet If the loginid parameter is not #null, then this servlet logs the user in by evaluating
(setAttribute request "login" loginid)Note it doesn't require a password and doesn't do any authentication, it just trusts them. It also has a link to q3.servlet.
q3logout.html This sets the session attribute "login" to #null and generates a link to the q3login.html page.
q3dbinit.servlet this creates the table q3UNETIDlog which contains two BLOBS: the loginid of the person visiting the page, and a timestamp of when the person visited the page (generated using (Date.)). Use your own UNETID in the name of the table ... This servlet also stores the request of the query in a variable r1 and then includes that variable in the response page, so we can see if there is an error.
q3.servlet this page does several things:
(getAttribute request "login")
is #null
. If they are not logged in
it throws a "not-logged-in" error.
(.toString (Date.))
.
HINT: