| Acknowledgments | p. xv |
| Introduction | p. xvii |
| Servlet Architecture and Environment | p. 1 |
| What Are Servlets? | p. 2 |
| Why Use Servlets? | p. 3 |
| Servlet API Background | p. 4 |
| What Do You Need to Get Started? | p. 5 |
| What Is Apache Tomcat? | p. 5 |
| Licensing | p. 7 |
| Installation | p. 9 |
| Starting and Testing Tomcat | p. 10 |
| Configuration | p. 12 |
| Alternatives | p. 15 |
| Summary | p. 16 |
| Servlet Development | p. 17 |
| The Basic Flow | p. 18 |
| Servlet Example: Properties | p. 20 |
| Summary | p. 27 |
| Session Management | p. 29 |
| Session Tracking | p. 30 |
| Cookies | p. 35 |
| URL Rewriting | p. 38 |
| Session Tracking Without a Browser | p. 41 |
| Session Events | p. 47 |
| Summary | p. 51 |
| Security | p. 53 |
| Servlet Security Methodologies | p. 54 |
| HTTP Authentication | p. 55 |
| Custom HTTP Authentication | p. 56 |
| HTML Form Authentication | p. 63 |
| Applet Authentication | p. 70 |
| SSL | p. 83 |
| Summary | p. 84 |
| Web Applications | p. 85 |
| Directory Structure | p. 86 |
| Web Application Archive: WAR Files | p. 88 |
| Deployment Descriptor | p. 89 |
| Summary | p. 125 |
| Filters | p. 127 |
| Your First Filter | p. 129 |
| Modifying the Response | p. 131 |
| Using XSLT to Transform Stock Quote Data | p. 136 |
| Summary | p. 149 |
| Application Event Listeners | p. 151 |
| ServletContextListener | p. 152 |
| ServletContextAttributeListener | p. 154 |
| HttpSessionListener | p. 157 |
| HttpSessionAttributeListener | p. 160 |
| Summary | p. 163 |
| HTML Forms | p. 165 |
| HTML Forms or Java Applets? | p. 166 |
| Form Basics | p. 166 |
| Putting It All Together: A Survey Form | p. 187 |
| The EchoSurvey Servlet | p. 192 |
| Summary | p. 196 |
| Using JDBC in Servlets | p. 197 |
| JDBC Overview | p. 198 |
| JDBC Servlet: EmployeeList | p. 214 |
| Splitting the Output into Separate Pages | p. 221 |
| Connection Pooling | p. 227 |
| Working with Images | p. 249 |
| Summary | p. 259 |
| Applet-to-Servlet Communication | p. 261 |
| HTTP | p. 262 |
| What Is Tunneling | p. 263 |
| The Basic Flow | p. 263 |
| Tunneling for Java 1.0.2 | p. 264 |
| Using Serialization | p. 298 |
| Summary | p. 321 |
| Automating Applet-to-Servlet Programming | p. 323 |
| Writing the Client Is Always the Same | p. 324 |
| Writing the Server Is Always the Same | p. 326 |
| Letting Java Write the Client and Server for You | p. 328 |
| Summary | p. 365 |
| J2ME-to-Servlet Communication | p. 367 |
| J2ME Overview | p. 368 |
| The Basic Flow | p. 369 |
| Marshaling Parameters and Return Values | p. 370 |
| The Base Micro Tunnel Client | p. 370 |
| The Base Tunnel Server | p. 376 |
| MIDlet Example: IndyMIDlet | p. 376 |
| The Remote Server | p. 386 |
| A Challenge | p. 389 |
| Summary | p. 389 |
| Generating WML for Wireless Devices | p. 391 |
| WAP Background | p. 392 |
| WML Example: HelloPhone | p. 393 |
| Using XSLT to Transform Stock Quote Data (Revisited) | p. 396 |
| Summary | p. 402 |
| Sending E-Mail from Servlets | p. 403 |
| What Are the Options? | p. 404 |
| Sending Mail Using SmtpClient | p. 405 |
| The JavaMail API | p. 410 |
| Summary | p. 425 |
| Using Servlets and Native Code | p. 427 |
| JNI Overview | p. 428 |
| Obligatory Hello World | p. 428 |
| Invoking Java Methods from C | p. 435 |
| Listing ODBC Data Sources | p. 440 |
| Summary | p. 451 |
| Performance Tips and Tricks | p. 453 |
| Avoid String Concatenation | p. 454 |
| Avoid Debugging Statements | p. 455 |
| Avoid Use of StringTokenizer | p. 456 |
| Avoid Unnecessary Synchronization | p. 457 |
| Use a Connection Pool | p. 458 |
| Use a PreparedStatement | p. 458 |
| Cache Expensive Objects | p. 458 |
| Tune Your Servlet Container | p. 461 |
| Tune Your Virtual Machine | p. 461 |
| Summary | p. 462 |
| The Servlet API | p. 463 |
| Filter | p. 464 |
| FilterChain | p. 466 |
| FilterConfig | p. 467 |
| GenericServlet | p. 468 |
| RequestDispatcher | p. 472 |
| Servlet | p. 474 |
| ServletConfig | p. 476 |
| ServletContext | p. 477 |
| ServletContextAttributeEvent | p. 483 |
| ServletContextAttributeListener | p. 484 |
| ServletContextEvent | p. 485 |
| ServletContextListener | p. 487 |
| ServletException | p. 488 |
| ServletlnputStream | p. 489 |
| ServletOutputStream | p. 491 |
| ServletRequest | p. 494 |
| ServletRequestWrapper | p. 500 |
| ServletResponse | p. 501 |
| ServletResponseWrapper | p. 504 |
| SingleThreadModel | p. 505 |
| UnavailableException | p. 505 |
| Cookie | p. 507 |
| HttpServlet | p. 512 |
| HttpServletRequest | p. 518 |
| HttpServletRequestWrapper | p. 524 |
| HttpServletResponse | p. 525 |
| HttpServletResponseWrapper | p. 535 |
| HttpSession | p. 535 |
| HttpSessionActivationListener | p. 539 |
| HttpSessionAttributeListener | p. 540 |
| HttpSessionBindingEvent | p. 542 |
| HttpSessionBindingListener | p. 543 |
| HttpSessionEvent | p. 544 |
| HttpSessionListener | p. 546 |
| The Web Application Deployment Descriptor | p. 547 |
| web-app | p. 548 |
| auth-constraint | p. 549 |
| context-param | p. 550 |
| error-page | p. 550 |
| filter | p. 550 |
| filter-mapping | p. 551 |
| form-login-config | p. 552 |
| icon | p. 552 |
| init-param | p. 553 |
| listener | p. 553 |
| login-config | p. 554 |
| mime-mapping | p. 554 |
| security-constraint | p. 555 |
| security-role | p. 555 |
| security-role-ref | p. 556 |
| servlet | p. 556 |
| servlet-mapping | p. 558 |
| session-config | p. 558 |
| user-data-constraint | p. 558 |
| web-resource-collection | p. 559 |
| welcome-file-list | p. 560 |
| Online Servlet Resources | p. 561 |
| Index | p. 563 |
| Table of Contents provided by Syndetics. All Rights Reserved. |