next up previous contents
Next: Java environment Up: Java Servlet Guide Previous: Acknowledgments and Thanks

Introduction to Java Servlets, Tomcat and Velocity

From Marty Hall's - Core Servlets and JavaServer Pages (JSP)[1]:

"Servlets are Java technology's answer to Common Gateway Interface (CGI) programming. They are programs that run on a Web server, acting as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTPP server. Their job is to:

  1. Read any data sent by the user
    This data is usually entered in a form on a Web page, but could also come from a Java applet or a custom HTTP client program.
  2. Look up any other information about the request that is embedded in the HTTP request
    This information includes details about browser capabilities, cookies, the host name of the requesting client, and so forth.
  3. Generate the results
    This process may result talking to a database, executing an RMI or CORBA call, invoking a legacy application or computing the response directly.
  4. Format the result inside a document
    In most cases, this involves embedding the information inside an HTML page.
  5. Set the appropriate HTTP response parameters
    This means telling the browser what type of document is being returned (e.g. HTML), setting cookies and caching parameters, and other such tasks.
  6. Send the document back to the client
    This document may be sent in text format (HTML), binary format (images), or even in a compressed format like gzip that is layered on top of some other underlying format."

Because we want to develop Java Servlets we need an server to develop Servlets, we will be using the Jakarta Tomcat server, mainly because it is part of an open source project (namely the Jakarta Project).

We will be using the Velocity template engine (also part from the Jakarta Project) because we want to develop a web application that makes use of HTML code and we do not want to program the HTML code in the Servlet source.



Subsections
next up previous contents
Next: Java environment Up: Java Servlet Guide Previous: Acknowledgments and Thanks
Copyright © 2001, R.M. Morriën, H.P.A.M. Snoek, M.A.C. Bakker