Apache Jakarta Tomcat is a Java application server, the open-source equivalent to BEA's WebLogic Server. It's also the official reference implementation for Sun's JSP and Servlet technologies. As the official implementation, millions of Java developers learning JSP need instruction and practical advice about Tomcat. However, there are currently few books and limited online resources to explain the nuances of JSP development using Tomcat.
Tomcat covers Tomcat 4.0.3 and 4.1, the latest versions developed for the current JSP and Servlet specifications. The book starts with the essentials of JSP and Servlets, then explains how to install and administer the Tomcat server. Further chapters discuss how Tomcat enhances application development with tag libraries, error logging, filters and valves, and more. It includes the use of the popular Apache Struts framework and Apache Axis XML processor. Later chapters explain advanced concepts such as Tomcat security and integrating Tomcat into larger J2EE applications.
From our reviewers: "This book is immediately applicable, it doesn't waste time. It's hard to digest the many topics that are rolled into Tomcat. But the authors provide a concise treatment that doesn't get bogged down in details. The chapters are like Lego blocks on each topic that developers can use to build applications. The book is a good balance of theory and practice that will quickly get you up to speed."
-Robert Herrmann, Committer, Tomcat Project
(NOTE: Each chapter concludes with a Summary.)
I. BASIC PRINCIPLES.1. Overview of Jakarta Tomcat, Servlets, and JSPs.
Why Have Server-Side Java? Introducing Jakarta Tomcat. Java Servlet Technology and JavaServer Pages. Tomcat and Static HTML Pages. Tomcat and J2EE.2. Installing Jakarta Tomcat.
Before Downloading Tomcat 4. Downloading Tomcat 4. Installing Tomcat. Checking the Installation. Stopping Tomcat. Running Tomcat with Multiple Instances.3. Basic Principles of Web Servers.
Hypertext Transfer Protocol. The Structure of an HTTP Message. The Structure of an HTTP Request. The Structure of an HTTP Response. Testing an HTTP Connection. Passing Request Parameters. Client Page Caching. URI Redirection and Page Refresh. Persistent Connections. Using HTTP from Within a Java Program.4. Basic Principles of Servlets.
Introduction to Servlets. Creating the Development Directory Structure. Creating the Currency Converter Servlet. Deploying the Currency Converter to Tomcat. Testing the Currency Converter. Configuring a Web Application Using a Deployment Descriptor. Adding URL Mapping to the Deployment Descriptor. Changing the Servlet Context Path. Automatically Reloading Servlets. Web Application Resource (WAR) Files. Adding Servlet Initialization Parameters. Servlet Life Cycle.5. Basic Principles of JSPs.
What Is a JSP? Deploying a JSP in Tomcat. Elements of a JSP Page. Currency Converter JSP. Using JavaBeans in a JSP. The Currency Converter JSP Using a JavaBean. The JSP Life Cycle. JSPs and the Deployment Descriptor File.6. Troubleshooting Servlets and JSPs.
Frequent Servlet and JSP Problems. Tomcat Not Responding. Mistyped URL. JSP Translation Errors. Java Compilation Errors. Invalid Deployment Descriptor. Java Logic/Algorithm Faults. Uncaught Java Exception. Invalid HTML. Tomcat Isn't Reloading Changed Applications Correctly.
II. DEVELOPMENT AND ADMINISTRATION.7. The Web Application Environment.
The Servlet Context Object. Forwarding HTTP Requests. The Request Object. The Response Object. Last Modified Times. Persistent Connections. JSP Implicit Objects. JSP Standard Actions. Servlet Listeners. Servlet Threading Issues. Welcome Files.8. Session Tracking.
Managing Session Data. Cookies. The Servlet Session Object. Hidden Fields. URL Rewriting.9. Databases and Tomcat.
Using JDBC and Data Sources. Direct JDBC Database Access. Tomcat Data Sources. Data Access Objects (DAOs). Security Considerations.10. Custom Tags and TagLibs.
Writing a Simple Custom Tag. Custom Tag Life Cycle. Changing Custom Tag Behavior. Iterative Tags. Using Tag Extra Information Classes. Exception Handling.11. JSP Expression Language and JSTL.
JSP Standard Tag Library (JSTL). Using JSTL with Request-Time Expressions. Expression Language Support. Flow Control Tags. URL Tags. Formatting Tags. Database and XML Tags.12. Error Handling.
User Input Errors. Pages Accessed Out of Order. Handling HTTP Response Errors. Servlet Exception Handling. JSP Error Handling. Error Handling in Custom Tags.13. Logging Using Tomcat.
Tomcat Logger Elements. J2SE 1.4 Logging API. Jakarta Log4j.14. Access Control.
Access Control Mechanisms. Security Realms. Configuring a JDBCRealm. Configuring a Tomcat MemoryRealm or JNDIRealm. Protecting Web Applications with Declarative Security. Programmatic Security. Tomcat's Single Sign-on Feature.15. Administering Tomcat in a Live Environment.
Essential Information for Tomcat Administrators. Starting and Stopping Tomcat. Using the Tomcat Manager Application. Administering Web Applications Manually. General Tomcat Housekeeping.16. Configuring Tomcat.
An Overview of Configuring the Tomcat Server. Tomcat 4.1 Web Server Administration Tool. Configuring Hosts. Changing Tomcat Port Numbers. Tomcat Server Configuration. Performance Issues. Configuring Access to Users' Home Directories. Controlling Client Access to Tomcat. Tomcat Default Deployment Descriptor. Managing Tomcat Users. Running Tomcat as a Service Under Windows.
III. ADVANCED TOPICS.17. Architectures.
Architecture and Design. Component Architecture. Frameworks. Model-1 Architecture. Model-2 Architecture. MVC Architecture. A Model-2/MVC Currency Converter.18. Servlet Filters.
What Is a Servlet Filter? Simple Filter Example. Other Uses for Filters. Using Wrapper Methods to Modify Request and Response Objects. Using a Filter as a Model-2 Architecture.19. Tomcat Valves.
Introduction to Tomcat Valves. Access Log Valve. Remote Address Filter. Remote Host Filter. Request Dumper Valve. Single Sign On Valve.20. Frameworks and Jakarta Struts.
Installing Jakarta Struts. Struts Architecture. A Simple Struts JSP. Defining the Struts Controller in web.xml. Simple Struts Action Mappings. Form Validation. Custom Action Controllers. Defining the View JSP. Other Struts Features.21. Testing with Jakarta Cactus.
Cactus Overview. Cactus Architecture. Cactus Test Life Cycle Methods. Testing a Currency Converter Servlet. Cactus Test Environment. Running the Example Cactus Test.22. Integrating Tomcat with a Web Server.
Obtaining the Web Server/Tomcat Plugin Software. Integrating Tomcat with Apache. Integrating with IIS. Web Access Control and User Credentials. Functional Separation Using Explicit URLs.23. Securing Web Applications Under Tomcat.
SSL Overview. Configuring SSL with Tomcat. Enabling Secure Login. Protecting Secure Web Resources with a Filter. Using a Security Manager.24. Tomcat and J2EE.
J2EE and Tomcat. Using JNDI. Sending Email Messages Using JavaMail.25. Web Services and Axis.
Distributed Application Services Overview. Apache Axis. A Simple Java Web Service. A Currency Converter Service.
IV. APPENDIXES.Appendix A. Apache Software License, Version 1.1.