Apache Struts



C H A P T E R 2
Servlet and JSP Review
S
truts is built on top of servlet technology, which is a basic infrastructure for building
webapps with the Java platform.
This technology is really a specification laid out by Sun, detailing the behavior of a
program called a servlet container. A servlet container takes care of parsing HTTP requests,
managing sessions, and compiling JavaServer Pages (JSPs), among other things.

Servlets are Java classes you write in order to handle HTTP requests and responses.
These classes are usually subclasses of HttpServlet, which has many convenience functions
to help your servlet subclasses do their job.

Anyone can implement Sun's Servlet specification, and in fact, there are many servlet
containers available. Popular ones include WebLogic from IBM and the freely available,
open source Tomcat from the Apache Software Foundation (ASF).

One of the beauties of Struts is that although it is dependent on servlet technology, you
can develop Struts applications with having to know much about servlets! This chapter
will equip you with everything you need to know about servlets for the journey ahead.

The first thing you need to do is install a servlet container on your machine.
Lab 2: Installing Tomcat
In this lab session, you'll install the Tomcat servlet container on your PC. Be sure to finish
this lab because you will be using Tomcat in subsequent chapters. Complete the following:

1.
Choose a convenient location on your hard drive on which to perform the installation.
Let's call this the INSTALL directory. For example, you might want to use C:\Tomcat\
as an INSTALL directory.

2.
From the Source Code section of the Apress website, found at http://www.
apress.com, copy the file jakarta-tomcat-5.0.28.zip to the INSTALL directory.