O’Reilly Java Servlet and JSP Cookbook

 

O’Reilly Java Servlet and JSP Cookbook

O'Reilly Java Servlet and JSP Cookbook

O’Reilly Java Servlet and JSP Cookbook

About:

Java Servlet & JSP Cookbook
By Bruce W. Perry
Publisher : O’Reilly
Pub Date : January 2004
ISBN : 0-596-00572-5
Pages : 746

Description:

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.

With truly many cases and a huge number of lines of code, the Java Servlet and JSP Cookbook yields tips and systems that any Java web engineer who utilizes JavaServer Pages or servlets will utilize each day, alongside undeniable answers for huge web application improvement issues that designers can embed straightforwardly into their own applications.Java Servlet and JSP Cookbook introduces genuine issues, and gives compact, commonsense answers for each. Finding even one tried code “formula” that takes care of a gnarly issue in this extensive accumulation of arrangements and best practices will spare hours of dissatisfaction – effortlessly advocating the expense of this important book.But “Java Servlet and JSP Cookbook” is more than only an abundance of cut-and-glue code. It likewise offers clear clarifications of how and why the code functions, cautions of potential pitfalls, and guides you to wellsprings of extra data, so you can figure out how to adjust the critical thinking systems to comparative situations.These formulas incorporate fundamental subjects like the utilization of Ant to setup a fabricate domain, broad scope of the WAR record position and web.xml organization descriptor, document transferring, mistake taking care of, treats, logging, managing non-HTML content, interactive media, demand separating, web administrations, I18N, web administrations, and a large group of different points that disappoint even the most prepared developers.For Java web designers of all levels why should anxious put into practice the hypothesis displayed in other API-centered books, the arrangements exhibited in this down to earth book will demonstrate important again and again. This is effortless route for less experienced designers who want to learn by doing to extend their aptitudes and efficiency, while fulfilling functional answers for the squeezing issues they confront each day. More experienced engineers can utilize these formulas to take care of tedious issues rapidly, arranging for their time for the more inventive parts of their work.

Content:

  1. Chapter 1 Writing Servlets and JSPs
    1. Introduction
    2. Writing a Servlet
    3. Writing a JSP
    4. Compiling a Servlet
    5. Packaging Servlets and JSPs
    6. Creating the Deployment Descriptor
  2. Chapter 2 Deploying Servlets and JSPs
    1. Introduction
    2. Deploying an Individual Servlet on Tomcat
    3. Using a Context Element in Tomcat’sserver.xml
    4. Deploying an Individual Servlet on WebLogic
    5. Deploying an Individual JSP on Tomcat
    6. Deploying an Individual JSP on WebLogic
    7. Deploying a Web Application on Tomcat
    8. Deploying a Web Application on WebLogic Using Ant
    9. Using the WebLogic Administration Console
    10. Using WebLogic Builder to Deploy a Web Application
    11. Using the weblogic.DeployerCommand-Line Tool
  3. Chapter 3 Naming Your Servlets
    1. Introduction
    2. Mapping a Servlet to a Name in web.xml
    3. Creating More Than One Mapping to a Servlet
    4. Creating a JSP-Type URL for a Servlet
    5. Mapping Static Content to a Servlet
    6. Invoking a Servlet Without a web.xml Mapping
    7. Mapping All Requests Within a Web Application to a Servlet
    8. Mapping Requests to a Controller and Preserving Servlet Mappings
    9. Creating Welcome Files for a Web Application
    10. Restricting Requests for Certain Servlets
    11. Giving Only the Controller Access to Certain Servlets
  4. Chapter 4 Using Apache Ant
    1. Introduction
    2. Obtaining and Setting Up Ant
    3. Using Ant Targets
    4. Including Tomcat JAR files in the Build File Classpath
    5. Compiling a Servlet with an Ant Build File
    6. Creating a WAR File with Ant
    7. Creating a JAR File with Ant
    8. Starting a Tomcat Application with Ant
    9. Stopping a Tomcat Application with Ant
  5. Chapter 5 Altering the Format of JSPs
    1. Introduction
    2. Precompiling a JSP in Tomcat
    3. Precompiling a JSP in WebLogic
    4. Precompiling JSPs with the Precompilation Protocol
    5. Mapping a JSP to Its Page Implementation Class
    6. Creating a JSP from Scratch as a JSP Document
    7. Generating an XML View from a JSP
  6. Chapter 6 Dynamically Including Content in Servlets and JSPs
    1. Introduction
    2. Including a Resource Each Time a Servlet Handles a Request
    3. Using an External Configuration to Include a Resource in a Servlet
    4. Including Resources Nested at Multiple Levels in a Servlet
    5. Including a Resource that Seldom Changes into a JSP
    6. Including Content in a JSP Each Time the JSP Handles a Request
    7. Using an External Configuration File to Include a Resource in a JSP
    8. Including an XML Fragment in a JSP Document
    9. Including Content from Outside a Context in a JSP
  7. Chapter 7 Handling Web Form Data in Servlets and JSPs
    1. Introduction
    2. Handling a POST HTTP Request in a Servlet
    3. Handling a POST HTTP Request in a JSP
    4. Setting the Properties of a JavaBean in a JSP
    5. Setting a Scoped Attribute in a JSP to the Value of a Form Parameter
    6. Posting Data from a Servlet
    7. Posting Data from a JSP
    8. Using a Servlet to Add a Parameter to a Query String
    9. Using a JSP to Add a Parameter to a Query String
    10. Using a Filter to Read Parameter Values
  8. Chapter 8 Uploading Files
    1. Introduction
    2. Preparing the HTML Page for File Uploads
    3. Using the com.oreilly.servlet Library
    4. Uploading One File at a Time
    5. Uploading Multiple Files
    6. Renaming Files
    7. Using a JSP to Handle a File Upload
  9. Chapter 9 Handling Exceptions in Web Applications
    1. Introduction
    2. Declaring Exception Handlers in web.xml
    3. Creating an Exception-Handling Servlet
    4. Sending an Error from a Servlet
    5. Sending an Error from a JSP
    6. Creating an Error-Handling JSP
    7. Declaring a Special Exception-Handling JSP for Other JSPs
  10. Chapter 10 Reading and Setting Cookies
    1. Introduction
    2. Setting a Cookie with a Servlet
    3. Creating an Array from All of the Request’s Cookies
    4. Setting a Cookie with a JSP
    5. Reading Cookie Values with a Servlet
    6. Reading Cookie Values with a JSP
    7. Altering or Removing a Cookie That Has Already Been Set
  11. Chapter 11 Session Tracking
    1. Introduction
    2. Setting the Session Timeout in web.xml
    3. Setting the Session Timeout in All Tomcat Web Applications
    4. Setting the Session Timeout Programmatically
    5. Checking if a Session Exists in an HttpServletRequest
    6. Tracking Session Activity in Servlets
    7. Tracking Session Activity in JSPs
    8. Using URL Rewriting in a JSP
    9. Using URL Rewriting in a Servlet
    10. Using a Listener to Track the Session Lifecycle
    11. Using a Listener to Monitor Session Attributes
    12. Using a Filter to Monitor Session Attributes
  12. Chapter 12 Integrating JavaScript with Servlets and JSPs
    1. Introduction
    2. Including JavaScript Modules in a Servlet
    3. Including JavaScript Modules in a JSP
    4. Creating a New Window with JavaScript in a Servlet
    5. Creating a New Window with JavaScript in a JSP
    6. Using JavaScript to Validate Form Values in a Servlet
    7. Using JavaScript to Validate Form Values in a JSP
  13. Chapter 13 Sending Non-HTML Content
    1. Introduction
    2. Sending a PDF File
    3. Sending a Word Processing File
    4. Sending an XML file
    5. Sending an Audio File
    6. Viewing Internal Resources in a Servlet
  14. Chapter 14 Logging Messages from Servlets and JSPs
    1. Introduction
    2. Logging Without Log4j
    3. Setting Up Log4j
    4. Using a Logger Without a Configuration File
    5. Adding an Appender to the Root Logger
    6. Using a Pattern with a Logger’s Appender
    7. Using log4j in a JSP
    8. Logging Messages Using a Servlet Context Event Listener
    9. Logging Messages Using a Session Event Listener
  15. Chapter 15 Authenticating Clients
    1. Introduction
    2. Creating Users and Passwords with Tomcat
    3. Setting Up SSL on Tomcat
    4. Using BASIC Authentication
    5. Using Form-Based Authentication
    6. Logging Out a User
    7. Using JAAS to Create a LoginModule
    8. Creating the JAAS Configuration File
    9. Using JAAS in a Servlet
    10. Using JAAS in a JSP
  16. Chapter 16 Binding, Accessing, and Removing Attributes in Web Applications
    1. Introduction
    2. Setting ServletContext Attributes in Servlets
    3. Setting ServletContext Attributes in JSPs
    4. Accessing or Removing ServletContext Attributes in Servlets
    5. Accessing or Removing ServletContext Attributes in JSPs
    6. Setting Session Attributes in Servlets
    7. Setting Session Attributes in JSPs
    8. Accessing or Removing Session Attributes in Servlets
    9. Accessing or Removing Session Attributes in JSPs
    10. Setting Request Attributes in Servlets
    11. Setting Request Attributes in JSPs
    12. Accessing or Removing Request Attributes in Servlets
    13. Accessing or Removing Request Attributes in JSPs
  17. Chapter 17 Embedding Multimedia in JSPs
    1. Introduction
    2. Embedding an Applet in a JSPUsing jsp:plugin
    3. Embedding an Applet in a JSP Using the HTML Converter
    4. Automatically Creating HTML Template for Including Flash Files
    5. Writing HTML Template to Embed a Flash File
    6. Embedding Flash in a Servlet
    7. Embedding a QuickTime Movie in a JSP
    8. Embedding an SVG File in a JSP
    9. Embedding a Background Soundtrack in a JSP
  18. Chapter 18 Working With the Client Request
    1. Introduction
    2. Examining HTTP Request Headers in a Servlet
    3. Examining HTTP Request Headers in a JSP
    4. Using a Filter to Alter Request Headers
    5. Automatically Refreshing a Servlet
    6. Automatically Refreshing a JSP
    7. Counting the Number of Web Application Requests
  19. Chapter 19 Filtering Requests and Responses
    1. Introduction
    2. Mapping a Filter to a Servlet
    3. Mapping a Filter to a JSP
    4. Mapping More Than One Filter to a Servlet
    5. Changing the Order in Which Filters are Applied to Servlets
    6. Configuring Initialization Parameters for a Filter
    7. Optionally Blocking a Request with a Filter
    8. Filtering the HTTP Response
    9. Using Filters with RequestDispatcher Objects
    10. Checking Form Parameters with a Filter
    11. Blocking IP Addresses with a Filter
  20. Chapter 20 Managing Email in Servlets and JSPs
    1. Introduction
    2. Placing the Email-Related Classes on your Classpath
    3. Sending Email from a Servlet
    4. Sending Email from a Servlet Using a JavaBean
    5. Accessing Email from a Servlet
    6. Accessing Email from a Servlet Using a JavaBean
    7. Handling Attachments from an Email Received in a Servlet
    8. Adding Attachments to an Email in a Servlet
    9. Reading a Received Email’s Headers from a Servlet
  21. Chapter 21 Accessing Databases
    1. Introduction
    2. Accessing a Database from a Servlet Without DataSource
    3. Configuring a DataSource in Tomcat
    4. Using a DataSource in a Servlet with Tomcat
    5. Creating a DataSource on WebLogic
    6. Using a JNDI Lookup to get a DataSource from WebLogic
    7. Using a DataSource from WebLogic in a JSP
    8. Calling a Stored Procedure from a Servlet
    9. Calling a Stored Procedure from a JSP
    10. Converting a ResultSet to a Result Object
    11. Executing Several SQL Statements Within a Single Transaction
    12. Using Transactions with JSPs
    13. Finding Information about a ResultSet
  22. Chapter 22 Using Custom Tag Libraries
    1. Introduction
    2. Creating a Classic Tag Handler
    3. Creating a JSP 1.2 TLD for a Classic Tag Handler
    4. Creating a JSP 2.0 TLD for a Classic Tag Handler
    5. Packaging a Tag Library in a Web Application
    6. Packaging the Tag Library in a JAR File
    7. Using the Custom Tag in a JSP
    8. Handling Exceptions in a Custom Tag Class
    9. Creating a Simple Tag Handler
    10. Creating a TLD for a Simple Tag Handler
    11. Using a Simple Tag Handler in a JSP
    12. Creating a JSP Tag File
    13. Packaging the JSP Tag File in a Web Application
    14. Packaging the JSP Tag File in a JAR
    15. Using a Custom Tag Associated with a Tag File
    16. Adding a Listener Class to a Tag Library
  23. Chapter 23 Using the JSTL
    1. Introduction
    2. Downloading the JSTL 1.0 and Using the JSTL Tags in JSPs
    3. Downloading the Java Web Services Developer Pack
    4. Using the Core JSTL Tags
    5. Using the XML Core JSTL Tags
    6. Using the XML Transform Tags
    7. Using the Formatting JSTL Tags
    8. Using A SQL JSTL Tag with a DataSource Configuration
    9. Using A SQL JSTL Tag Without a DataSource Configuration
    10. Accessing Scoped Variables with the EL
    11. Accessing Request Parameters with the EL
    12. Using the EL to Access Request Headers
    13. Using the EL to Access One Request Header
    14. Accessing Cookies with the EL
    15. Using the EL to Access JavaBean Properties
    16. Using JSTL Functions
  24. Chapter 24 Internationalization
    1. Introduction
    2. Detecting the Client Locale in a Servlet
    3. Detecting the Client’s Locales in a JSP
    4. Creating a ResourceBundle as a Properties File
    5. Creating a ResourceBundle as a Java Class
    6. Using the ResourceBundle in a Servlet
    7. Using the ResourceBundle in a JSP
    8. Formatting Dates in a Servlet
    9. Formatting Dates in a JSP
    10. Formatting Currencies in a Servlet
    11. Formatting Currencies in a JSP
    12. Formatting Percentages in a Servlet
    13. Formatting Percentages in a JSP
    14. Setting the Localization Context in the Deployment Descriptor
  25. Chapter 25 Using JNDI and Enterprise JavaBeans
    1. Introduction
    2. Configuring a JNDI Object in Tomcat
    3. Accessing the Tomcat JNDI Resource from a Servlet
    4. Accessing the Tomcat JNDI Resource from a JSP
    5. Configuring a JNDI Resource in WebLogic
    6. Viewing the JNDI Tree in WebLogic
    7. Accessing the WebLogic JNDI Resource from a Servlet
    8. Accessing the WebLogic JNDI Resource from a JSP
    9. Accessing an EJB Using the WebLogic JNDI Tree
  26. Chapter 26 Harvesting Web Information
    1. Introduction
    2. Parsing an HTML Page Using thejavax.swing.text Subpackages
    3. Using a Servlet to Harvest Web Data
    4. Creating a JavaBean as a Web Page Parser
    5. Using the Web Page Parsing JavaBean in a Servlet
    6. Using the Web Page Parsing JavaBean in a JSP
  27. Chapter 27 Using the Google and Amazon Web APIs
    1. Introduction
    2. Getting Set Up with Google’s Web API
    3. Creating a JavaBean to Connect with Google
    4. Using a Servlet to Connect with Google
    5. Using a JSP to Connect with Google
    6. Getting Set Up with Amazon’s Web Services API
    7. Creating a JavaBean to Connect with Amazon
    8. Using a Servlet to Connect with Amazon
    9. Using a JSP to Connect with Amazon
  1. Colophon

 

O’Reilly Java Servlet and JSP Cookbook

O’Reilly Java Servlet and JSP Cookbook

Leave a Reply

Your email address will not be published. Required fields are marked *

*