Synopses & Reviews
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.
Synopsis
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. "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.
Synopsis
Java servlets offer a fast, powerful, portable replacement for CGI scripts. This book covers everything one needs to write effective servlets. Topics include serving dynamic Web content, maintaining state information, session tracking, database connectivity using JDBC, and applet-servlet communication.
About the Author
Jason Hunter is Senior Technologist with CollabNet, a company that provides tools and services for open source style collaboration. In addition to authoring Java Servlet Programming, he is publisher of Servlets.com, creator of the com.oreilly.servlet library, a contributor to the Apache Jakarta project that creates Tomcat (starting on the project when it was still Sun internal), a member of the expert groups responsible for Servlet/JSP and JAXP API development, and he holds a seat on the JCP Executive Committee overseeing the Java platform, as a representative of the Apache Software Foundation. He also writes columns for JavaWorld, and speaks at many programming and open source conferences. Most recently he co-created the open source JDOM library to enable optimized Java and XML integration, and he leads the expert group responsible for JDOM development. Jason graduated summa cum laude from Willamette University (Salem, Oregon) in 1995 with a degree in computer science. He began programming in Java in the summer of 1995 and has been involved with servlets and related server-side technologies since December 1996. If by some miracle you don't find him at work, he's probably out hiking in the mountains.
Table of Contents
Preface; Audience; About the Examples; Organization; Conventions Used in This Book; Request for Comments; Acknowledgments; Chapter 1: Introduction; 1.1 History of Web Applications; 1.2 Support for Servlets; 1.3 The Power of Servlets; Chapter 2: HTTP Servlet Basics; 2.1 HTTP Basics; 2.2 The Servlet API; 2.3 Page Generation; 2.4 Server-Side Includes; 2.5 Servlet Chaining and Filters; 2.6 JavaServer Pages; 2.7 Moving On; Chapter 3: The Servlet Life Cycle; 3.1 The Servlet Alternative; 3.2 Servlet Reloading; 3.3 Init and Destroy; 3.4 Single-Thread Model; 3.5 Background Processing; 3.6 Last Modified Times; Chapter 4: Retrieving Information; 4.1 Initialization Parameters; 4.2 The Server; 4.3 The Client; 4.4 The Request; Chapter 5: Sending HTML Information; 5.1 The Structure of a Response; 5.2 Sending a Normal Response; 5.3 Using Persistent Connections; 5.4 HTML Generation; 5.5 Status Codes; 5.6 HTTP Headers; 5.7 When Things Go Wrong; Chapter 6: Sending Multimedia Content; 6.1 Images; 6.2 Compressed Content; 6.3 Server Push; Chapter 7: Session Tracking; 7.1 User Authorization; 7.2 Hidden Form Fields; 7.3 URL Rewriting; 7.4 Persistent Cookies; 7.5 The Session Tracking API; Chapter 8: Security; 8.1 HTTP Authentication; 8.2 Digital Certificates; 8.3 Secure Sockets Layer (SSL); 8.4 Running Servlets Securely; Chapter 9: Database Connectivity; 9.1 Relational Databases; 9.2 The JDBC API; 9.3 Reusing Database Objects; 9.4 Transactions; 9.5 Advanced JDBC Techniques; Chapter 10: Applet-Servlet Communication; 10.1 Communication Options; 10.2 Daytime Server; 10.3 Chat Server; Chapter 11: Interservlet Communication; 11.1 Servlet Manipulation; 11.2 Servlet Reuse; 11.3 Servlet Collaboration; 11.4 Recap; Chapter 12: Internationalization; 12.1 Western European Languages; 12.2 Conforming to Local Customs; 12.3 Non-Western European Languages; 12.4 Multiple Languages; 12.5 Dynamic Language Negotiation; 12.6 HTML Forms; 12.7 Receiving Multilingual Input; Chapter 13: Odds and Ends; 13.1 Parsing Parameters; 13.2 Sending Email; 13.3 Using Regular Expressions; 13.4 Executing Programs; 13.5 Using Native Methods; 13.6 Acting as an RMI Client; 13.7 Debugging; 13.8 Performance Tuning; Servlet API Quick Reference; HTTP Servlet API Quick Reference; HTTP Status Codes; Character Entities; Charsets; Colophon;