Java Servlet Programming
A few years ago, the hype surrounding applets put Java on the map as a programming language for the Web. Today, Java servlets stand poised to take Java to the next level as a Web development language. The main reason is that servlets offer a fast, powerful, portable replacement for CGI scripts.
The Java Servlet API, introduced as the first standard extension to Java, provides a generic mechanism to extend the functionality of any kind of server. Servlets are most commonly used, however, to extend Web servers, performing tasks traditionally handled by CGI programs. Web servers that can support servlets include: Apache, Netscape's FastTrack and Enterprise Servers, Microsoft's IIS, O'Reilly's WebSite, and JavaSoft's Java Web Server.
The beauty of servlets is that they execute within the Web server's process space and they persist between invocations. This gives servlets tremendous performance benefits over CGI programs. Yet because they're written in Java, servlets are far less likely to crash a Web server than a C-based NSAPI or ISAPI extension. Servlets have full access to the various Java APIs and to third-party component classes, making them ideal for use in communicating with applets, databases, and RMI servers. Plus, servlets are portable between operating systems and between servers -- with servlets you can "write once, serve everywhere."
Java Servlet Programming covers everything you need to know to write effective servlets and includes numerous examples that you can use as the basis for your own servlets. The book explains the servlet life cycle, showing how you can use servlets to maintain state information effortlessly. It also describes how to serve dynamic Web content, including both HTML pages and multimedia data. Finally, it explores more advanced topics like integrated session tracking, efficient database connectivity using JDBC, applet-servlet communication, inter-servlet communication, and internationalization.
Table of Contents
Chapter 1 Introduction
History of Web Applications
Support for Servlets
The Power of Servlets
Chapter 2 HTTP Servlet Basics
HTTP Basics
The Servlet API
Page Generation
Server-Side Includes
Servlet Chaining and Filters
JavaServer Pages
Moving On
Chapter 3 The Servlet Life Cycle
The Servlet Alternative
Servlet Reloading
Init and Destroy
Single-Thread Model
Background Processing
Last Modified Times
Chapter 4 Retrieving Information
Initialization Parameters
The Server
The Client
The Request
Chapter 5 Sending HTML Information
The Structure of a Response
Sending a Normal Response
Using Persistent Connections
HTML Generation
Status Codes
HTTP Headers
When Things Go Wrong
Chapter 6 Sending Multimedia Content
Images
Compressed Content
Server Push
Chapter 7 Session Tracking
User Authorization
Hidden Form Fields
URL Rewriting
Persistent Cookies
The Session Tracking API
Chapter 8 Security
HTTP Authentication
Digital Certificates
Secure Sockets Layer (SSL)
Running Servlets Securely
Chapter 9 Database Connectivity
Relational Databases
The JDBC API
Reusing Database Objects
Transactions
Advanced JDBC Techniques
Chapter 10 Applet-Servlet Communication
Communication Options
Daytime Server
Chat Server
Chapter 11 Interservlet Communication
Servlet Manipulation
Servlet Reuse
Servlet Collaboration
Recap
Chapter 12 Internationalization
Western European Languages
Conforming to Local Customs
Non-Western European Languages
Multiple Languages
Dynamic Language Negotiation
HTML Forms
Receiving Multilingual Input
Chapter 13 Odds and Ends
Parsing Parameters
Sending Email
Using Regular Expressions
Executing Programs
Using Native Methods
Acting as an RMI Client
Debugging
Performance Tuning
Appendix Servlet API Quick Reference
Appendix HTTP Servlet API Quick Reference
Appendix HTTP Status Codes
Appendix Character Entities
Appendix Charsets
Colophon




0 commentaires:
Post a Comment