The Servlet Extension

Introduction

This extension is primarily about writing a Java Servlet. The extension is primarily for students who has followed the course Web Programming or has basic skills in html.

About servlets

A Java Servlet is a program, which is run on a server for homepages. The main idea is, that when a browser asks for a given homepage, the server of the homepage calls the servlet. The servlet then creates a homepage, which is returned to the browser.

The following links contains usefull informations about servlets:

You can be inspired by the way google works when creating your servlet.

Servlets at it-c

If you want to use servlets at IT-C you must use a Tomcat server. The sysadm has written a paper on how this is done, which can be downloaded here (it is in danish). You will have to use a machine running linux. The paper contains no information on, how a homepage calling a servlet is made. This is descriped in the API reference. With the Tomcat server at IT-C you can do it in the following steps:

For instance the following homepage AdditionForm.html references a servlet AdditionServlet.java, which is run by beetle.