Java Servlet Programming
Revision: TE2404_20060318
Course Length:
2 Days
Course Description:
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.
Who Should Attend:
This course is designed for CGI programmers, JavaScript programmers, Java Applet programmers and authors of Web pages.
Benefits of Attendance:
Upon completion of this course, students will be able to:
- Understand how and when a servlet is loaded, and how and when it is executed.
- Understand how threads are managed and how to handle the synchronization issues in a multi-threaded system.
- Understand how a servlet can generate HTML, return errors, redirect requests, and write data to the server log.
- How to maintain security with servlets.
- Have servlets communicate with one another.
- Understand which charsets servlets may use to generate content in several languages.
Prerequisites:
Experience with Java programming is required.
Course Outline:
- Chapter 1: Introduction
- 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
- Processing HTML form data with a servlet
- The Servlet Life Cycle
- Chapter 2: Handling Request Information
- Request Information
- HttpServletRequest
- Processing POST Data
- Initialization Parameters
- JSWDK Initialization Parameters
- Server Information
- Extra Path Information
- What Was Requested?
- Chapter 3: Handling Responses
- 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
- Chapter 4: Threads And Servlets
- Introduction
- Thread Issues
- Synchronization
- Locks
- Terminology
- wait() and notify()
- Threads and Servlets
- SingleThreadModel
- Chapter 5: Session Management
- Sessions
- Session IDs
- Cookies
- Session Management using the Servlet API
- Invalidating Sessions
- Chapter 6: Servlet Communication
- Introduction
- ServletContext
- Sharing Data among servlets
- Dispatching Requests
- Saving the State of a Servlet
- Appendix A: An HTML Primer
- Appendix B: JavaServer Pages
- Appendix C: JDBC + Servlets



