Java Servlet & JSP Cookbook - Perry_ Bruce W_.pdf

(5296 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
[ Team LiB ]
Table of Contents
Index
Reviews
Reader Reviews
Errata
Academic
Java Servlet & JSP Cookbook
By Bruce W. Perry
Publisher: O'Reilly
Pub Date: January 2004
ISBN: 0-596-00572-5
Pages: 746
With literally hundreds of examples and thousands of lines of code, the Java Servlet and JSP
Cookbook yields tips and techniques that any Java web developer who uses JavaServer Pages or
servlets will use every day, along with full-fledged solutions to significant web application
development problems that developers can insert directly into their own applications.
[ Team LiB ]
878741966.184.png 878741966.195.png 878741966.206.png 878741966.217.png 878741966.001.png 878741966.012.png 878741966.023.png 878741966.034.png 878741966.045.png 878741966.056.png 878741966.067.png 878741966.078.png 878741966.089.png 878741966.100.png 878741966.111.png 878741966.122.png
[ Team LiB ]
Table of Contents
Index
Reviews
Reader Reviews
Errata
Academic
Java Servlet & JSP Cookbook
By Bruce W. Perry
UNREGISTERED VERSION OF CHM TO PDF CONVERTER By THETA-SOFTWARE
Publisher: O'Reilly
Pub Date: January 2004
ISBN: 0-596-00572-5
Pages: 746
Copyright
Preface
What's in the Book
Audience
Organization
Conventions Used in This Book
Using Code Examples
Comments and Questions
Acknowledgments
Chapter 1. Writing Servlets and JSPs
Introduction
Recipe 1.1. Writing a Servlet
Recipe 1.2. Writing a JSP
Recipe 1.3. Compiling a Servlet
Recipe 1.4. Packaging Servlets and JSPs
Recipe 1.5. Creating the Deployment Descriptor
Chapter 2. Deploying Servlets and JSPs
Introduction
Recipe 2.1. Deploying an Individual Servlet on Tomcat
Recipe 2.2. Using a Context Element in Tomcat'sserver.xml
Recipe 2.3. Deploying an Individual Servlet on WebLogic
Recipe 2.4. Deploying an Individual JSP on Tomcat
Recipe 2.5. Deploying an Individual JSP on WebLogic
Recipe 2.6. Deploying a Web Application on Tomcat
Recipe 2.7. Deploying a Web Application on WebLogic Using Ant
878741966.133.png 878741966.144.png 878741966.148.png 878741966.149.png 878741966.150.png 878741966.151.png 878741966.152.png 878741966.153.png 878741966.154.png 878741966.155.png 878741966.156.png 878741966.157.png 878741966.158.png 878741966.159.png 878741966.160.png 878741966.161.png 878741966.162.png 878741966.163.png 878741966.164.png 878741966.165.png 878741966.166.png 878741966.167.png 878741966.168.png 878741966.169.png 878741966.170.png 878741966.171.png 878741966.172.png 878741966.173.png 878741966.174.png 878741966.175.png 878741966.176.png 878741966.177.png 878741966.178.png 878741966.179.png 878741966.180.png 878741966.181.png 878741966.182.png 878741966.183.png 878741966.185.png 878741966.186.png
Recipe 2.8. Using the WebLogic Administration Console
Recipe 2.9. Using WebLogic Builder to Deploy a Web Application
Recipe 2.10. Using the weblogic.DeployerCommand-Line Tool
Chapter 3. Naming Your Servlets
Introduction
Recipe 3.1. Mapping a Servlet to a Name in web.xml
Recipe 3.2. Creating More Than One Mapping to a Servlet
Recipe 3.3. Creating a JSP-Type URL for a Servlet
Recipe 3.4. Mapping Static Content to a Servlet
Recipe 3.5. Invoking a Servlet Without a web.xml Mapping
Recipe 3.6. Mapping All Requests Within a Web Application to a Servlet
Recipe 3.7. Mapping Requests to a Controller and Preserving Servlet Mappings
Recipe 3.8. Creating Welcome Files for a Web Application
Recipe 3.9. Restricting Requests for Certain Servlets
Recipe 3.10. Giving Only the Controller Access to Certain Servlets
Chapter 4. Using Apache Ant
Introduction
Recipe 4.1. Obtaining and Setting Up Ant
Recipe 4.2. Using Ant Targets
Recipe 4.3. Including Tomcat JAR files in the Build File Classpath
Recipe 4.4. Compiling a Servlet with an Ant Build File
Recipe 4.5. Creating a WAR File with Ant
Recipe 4.6. Creating a JAR File with Ant
Recipe 4.7. Starting a Tomcat Application with Ant
Recipe 4.8. Stopping a Tomcat Application with Ant
Chapter 5. Altering the Format of JSPs
Introduction
Recipe 5.1. Precompiling a JSP in Tomcat
Recipe 5.2. Precompiling a JSP in WebLogic
Recipe 5.3. Precompiling JSPs with the Precompilation Protocol
Recipe 5.4. Mapping a JSP to Its Page Implementation Class
Recipe 5.5. Creating a JSP from Scratch as a JSP Document
Recipe 5.6. Generating an XML View from a JSP
Chapter 6. Dynamically Including Contentin Servlets and JSPs
Introduction
Recipe 6.1. Including a Resource Each Time a Servlet Handles a Request
Recipe 6.2. Using an External Configuration to Include a Resource in a Servlet
Recipe 6.3. Including Resources Nested at Multiple Levels in a Servlet
Recipe 6.4. Including a Resource that Seldom Changes into a JSP
Recipe 6.5. Including Content in a JSP Each Time the JSP Handles a Request
Recipe 6.6. Using an External Configuration File to Include a Resource in a JSP
Recipe 6.7. Including an XML Fragment in a JSP Document
Recipe 6.8. Including Content from Outside a Context in a JSP
Chapter 7. Handling Web Form Data inServlets and JSPs
Introduction
Recipe 7.1. Handling a POST HTTP Request in a Servlet
Recipe 7.2. Handling a POST HTTP Request in a JSP
Recipe 7.3. Setting the Properties of a JavaBean in a JSP
Recipe 7.4. Setting a Scoped Attribute in a JSP to the Value of a Form Parameter
Recipe 7.5. Posting Data from a Servlet
Recipe 7.6. Posting Data from a JSP
Recipe 7.7. Using a Servlet to Add a Parameter to a Query String
Recipe 7.8. Using a JSP to Add a Parameter to a Query String
Recipe 7.9. Using a Filter to Read Parameter Values
878741966.187.png 878741966.188.png 878741966.189.png 878741966.190.png 878741966.191.png 878741966.192.png 878741966.193.png 878741966.194.png 878741966.196.png 878741966.197.png 878741966.198.png 878741966.199.png 878741966.200.png 878741966.201.png 878741966.202.png 878741966.203.png 878741966.204.png 878741966.205.png 878741966.207.png 878741966.208.png 878741966.209.png 878741966.210.png 878741966.211.png 878741966.212.png 878741966.213.png 878741966.214.png 878741966.215.png 878741966.216.png 878741966.218.png 878741966.219.png 878741966.220.png 878741966.221.png 878741966.222.png 878741966.223.png 878741966.224.png 878741966.225.png 878741966.226.png 878741966.227.png 878741966.002.png 878741966.003.png 878741966.004.png 878741966.005.png 878741966.006.png 878741966.007.png 878741966.008.png 878741966.009.png 878741966.010.png 878741966.011.png 878741966.013.png 878741966.014.png 878741966.015.png 878741966.016.png 878741966.017.png 878741966.018.png 878741966.019.png 878741966.020.png 878741966.021.png
Chapter 8. Uploading Files
Introduction
Recipe 8.1. Preparing the HTML Page for File Uploads
Recipe 8.2. Using the com.oreilly.servlet Library
Recipe 8.3. Uploading One File at a Time
Recipe 8.4. Uploading Multiple Files
Recipe 8.5. Renaming Files
Recipe 8.6. Using a JSP to Handle a File Upload
Chapter 9. Handling Exceptions in Web Applications
Introduction
Recipe 9.1. Declaring Exception Handlers in web.xml
Recipe 9.2. Creating an Exception-Handling Servlet
Recipe 9.3. Sending an Error from a Servlet
Recipe 9.4. Sending an Error from a JSP
Recipe 9.5. Creating an Error-Handling JSP
Recipe 9.6. Declaring a Special Exception-Handling JSP for Other JSPs
Chapter 10. Reading and Setting Cookies
Introduction
UNREGISTERED VERSION OF CHM TO PDF CONVERTER By THETA-SOFTWARE
Recipe 10.1. Setting a Cookie with a Servlet
Recipe 10.2. Creating an Array from All of the Request's Cookies
Recipe 10.3. Setting a Cookie with a JSP
Recipe 10.4. Reading Cookie Values with a Servlet
Recipe 10.5. Reading Cookie Values with a JSP
Recipe 10.6. Altering or Removing a Cookie That Has Already Been Set
Chapter 11. Session Tracking
Introduction
Recipe 11.1. Setting the Session Timeout in web.xml
Recipe 11.2. Setting the Session Timeout in All Tomcat Web Applications
Recipe 11.3. Setting the Session Timeout Programmatically
Recipe 11.4. Checking if a Session Exists in an HttpServletRequest
Recipe 11.5. Tracking Session Activity in Servlets
Recipe 11.6. Tracking Session Activity in JSPs
Recipe 11.7. Using URL Rewriting in a JSP
Recipe 11.8. Using URL Rewriting in a Servlet
Recipe 11.9. Using a Listener to Track the Session Lifecycle
Recipe 11.10. Using a Listener to Monitor Session Attributes
Recipe 11.11. Using a Filter to Monitor Session Attributes
Chapter 12. Integrating JavaScript with Servlets and JSPs
Introduction
Recipe 12.1. Including JavaScript Modules in a Servlet
Recipe 12.2. Including JavaScript Modules in a JSP
Recipe 12.3. Creating a New Window with JavaScript in a Servlet
Recipe 12.4. Creating a New Window with JavaScript in a JSP
Recipe 12.5. Using JavaScript to Validate Form Values in a Servlet
Recipe 12.6. Using JavaScript to Validate Form Values in a JSP
Chapter 13. Sending Non-HTML Content
Introduction
Recipe 13.1. Sending a PDF File
Recipe 13.2. Sending a Word Processing File
Recipe 13.3. Sending an XML file
Recipe 13.4. Sending an Audio File
Recipe 13.5. Viewing Internal Resources in a Servlet
Chapter 14. Logging Messages from Servlets and JSPs
Introduction
878741966.022.png 878741966.024.png 878741966.025.png 878741966.026.png 878741966.027.png 878741966.028.png 878741966.029.png 878741966.030.png 878741966.031.png 878741966.032.png 878741966.033.png 878741966.035.png 878741966.036.png 878741966.037.png 878741966.038.png 878741966.039.png 878741966.040.png 878741966.041.png 878741966.042.png 878741966.043.png 878741966.044.png 878741966.046.png 878741966.047.png 878741966.048.png 878741966.049.png 878741966.050.png 878741966.051.png 878741966.052.png 878741966.053.png 878741966.054.png 878741966.055.png 878741966.057.png 878741966.058.png 878741966.059.png 878741966.060.png 878741966.061.png 878741966.062.png 878741966.063.png 878741966.064.png 878741966.065.png 878741966.066.png 878741966.068.png 878741966.069.png 878741966.070.png 878741966.071.png 878741966.072.png 878741966.073.png 878741966.074.png 878741966.075.png 878741966.076.png 878741966.077.png 878741966.079.png 878741966.080.png 878741966.081.png 878741966.082.png 878741966.083.png 878741966.084.png
Recipe 14.1. Logging Without Log4j
Recipe 14.2. Setting Up Log4j
Recipe 14.3. Using a Logger Without a Configuration File
Recipe 14.4. Adding an Appender to the Root Logger
Recipe 14.5. Using a Pattern with a Logger's Appender
Recipe 14.6. Using log4j in a JSP
Recipe 14.7. Logging Messages Using a Servlet Context Event Listener
Recipe 14.8. Logging Messages Using a Session Event Listener
Chapter 15. Authenticating Clients
Introduction
Recipe 15.1. Creating Users and Passwords with Tomcat
Recipe 15.2. Setting Up SSL on Tomcat
Recipe 15.3. Using BASIC Authentication
Recipe 15.4. Using Form-Based Authentication
Recipe 15.5. Logging Out a User
Recipe 15.6. Using JAAS to Create a LoginModule
Recipe 15.7. Creating the JAAS Configuration File
Recipe 15.8. Using JAAS in a Servlet
Recipe 15.9. Using JAAS in a JSP
Chapter 16. Binding, Accessing, and Removing Attributes in Web Applications
Introduction
Recipe 16.1. Setting ServletContext Attributes in Servlets
Recipe 16.2. Setting ServletContext Attributes in JSPs
Recipe 16.3. Accessing or Removing ServletContext Attributes in Servlets
Recipe 16.4. Accessing or Removing ServletContext Attributes in JSPs
Recipe 16.5. Setting Session Attributes in Servlets
Recipe 16.6. Setting Session Attributes in JSPs
Recipe 16.7. Accessing or Removing Session Attributes in Servlets
Recipe 16.8. Accessing or Removing Session Attributes in JSPs
Recipe 16.9. Setting Request Attributes in Servlets
Recipe 16.10. Setting Request Attributes in JSPs
Recipe 16.11. Accessing or Removing Request Attributes in Servlets
Recipe 16.12. Accessing or Removing Request Attributes in JSPs
Chapter 17. Embedding Multimedia in JSPs
Introduction
Recipe 17.1. Embedding an Applet in a JSPUsing jsp:plugin
Recipe 17.2. Embedding an Applet in a JSP Using the HTML Converter
Recipe 17.3. Automatically Creating HTML Template for Including Flash Files
Recipe 17.4. Writing HTML Template to Embed a Flash File
Recipe 17.5. Embedding Flash in a Servlet
Recipe 17.6. Embedding a QuickTime Movie in a JSP
Recipe 17.7. Embedding an SVG File in a JSP
Recipe 17.8. Embedding a Background Soundtrack in a JSP
Chapter 18. Working With the Client Request
Introduction
Recipe 18.1. Examining HTTP Request Headers in a Servlet
Recipe 18.2. Examining HTTP Request Headers in a JSP
Recipe 18.3. Using a Filter to Alter Request Headers
Recipe 18.4. Automatically Refreshing a Servlet
Recipe 18.5. Automatically Refreshing a JSP
Recipe 18.6. Counting the Number of Web Application Requests
Chapter 19. Filtering Requests and Responses
Introduction
Recipe 19.1. Mapping a Filter to a Servlet
878741966.085.png 878741966.086.png 878741966.087.png 878741966.088.png 878741966.090.png 878741966.091.png 878741966.092.png 878741966.093.png 878741966.094.png 878741966.095.png 878741966.096.png 878741966.097.png 878741966.098.png 878741966.099.png 878741966.101.png 878741966.102.png 878741966.103.png 878741966.104.png 878741966.105.png 878741966.106.png 878741966.107.png 878741966.108.png 878741966.109.png 878741966.110.png 878741966.112.png 878741966.113.png 878741966.114.png 878741966.115.png 878741966.116.png 878741966.117.png 878741966.118.png 878741966.119.png 878741966.120.png 878741966.121.png 878741966.123.png 878741966.124.png 878741966.125.png 878741966.126.png 878741966.127.png 878741966.128.png 878741966.129.png 878741966.130.png 878741966.131.png 878741966.132.png 878741966.134.png 878741966.135.png 878741966.136.png 878741966.137.png 878741966.138.png 878741966.139.png 878741966.140.png 878741966.141.png 878741966.142.png 878741966.143.png 878741966.145.png 878741966.146.png 878741966.147.png
Zgłoś jeśli naruszono regulamin