Simple Servlet tutorial

About this tutorial.

This tutorial is an example of using Servlets.
It is about registering cars to a Car-park and let the
servlet response to the client with a list of all registered cars
each time a new car is registered.

We are not using any persistent storage in this example so
all registered cars
will be stored in a Vector which is stored in the user session object.
Therefore, when the session is ended all data is gone. A similar Servlet
application with use of persistent storage can be found in the
Servlet Examples.

It is recommended that you study all the subjects that are under
Java Servlets menu.

If you just want to look through the solution of this tutorial you can download it
here

When the user Submit this form our CarparkServlet, which we will create in the back-end part, come in action and
handle this POST request which will contain the parameters: regNo, cartype, model and dayPrice.

For each new registered car, we want to have a car object that we add to a dynamic Vector on the session object, which exist in the servlet.

Creating the Back-end.

Create data transporter and controller.

To collect data for each registration we need a java class
which we can use to create new objects for each car registration.