Java Servlet Programming
Rev. 1.0

This 2-day course covers Java servlet programming. Prior to Java servlets, dynamic content from your Web server was accomplished by CGI and proprietary APIs. This course details a third way - the Java Servlet Development Kit (JSDK). The JSDK lets you extend a Java-enabled Web server with servlets, server-side components written in Java. These components are platform and protocol independent. Servlets can be used to replace CGI, process forms, interact with the database or as a middle tier in a three-tiered architecture.

LEARNING OBJECTIVES

Course Duration: 2 days

Prerequisites: Experience with fundamental Java programming.

  1. Introduction
  2. Servlets
    The HTTP protocol
    The request/response paradigm
    HTTP methods
    Servlet Classes
    A Simple Servlet
    Preparing the Servlet
    Creating your Web Application
    Starting the Server
    Running DateServlet
    Servlet Engines
    Processing HTML form data with a servlet
    The Servlet Life Cycle

  3. Handling Request Information
  4. Request Information
    HttpServletRequest
    Processing POST Data
    Initialization Parameters
    JSWDK Initialization Parameters
    Server Information
    Extra Path Information
    What Was Requested?

  5. Generating Http
  6. Servlet Responses
    Status Codes
    Writers and Streams
    Content Type
    Keep-Alive Connections
    Automatic HTML generation
    Additional Response headers
    Server Redirection
    Client Pull
    Error Handling
    SendError
    Logging Errors

  7. Threads And Servlets
  8. Thread
    Synchronization
    Locks
    Terminology
    wait() and notify()
    Threads and Servlets
    SingleThreadModel

  9. Session Management
  10. Cookies
    Sessions
    The HTTP Protocol Problem
    Session IDs
    Session Management using the Servlet API
    Invalidating Sessions

  11. Servlet Communication

ServletContext
Saving the State of a Servlet
Using Property Lists
Using Attributes
Using a Shared Object
Servlet Chaining

Appendix A. An HMTL Primer

Preview
Basics
Formatting Basics
Links
Forms

Appendix B. Java Server Pages

Java Server Pages
Syntax of JSP
JSP Bean Example

Appendix C. JDBC and Servlets

Client/Server Architectures
JDBC
A JDBC Query
A Servlet with JDBC