Skip Headers
Oracle® Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide
10g Release 2 (10.1.2)
Part No. B14014-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Index
Index

Next
Next
 

Contents

Title and Copyright Information

Send Us Your Comments

Preface

Intended Audience
Documentation Accessibility
Structure
Related Documents
Conventions

1 General JSP Overview

Introduction to JavaServer Pages
What a JSP Page Looks Like
Convenience of JSP Coding Versus Servlet Coding
Servlet Code
JSP Code
Separation of Business Logic from Page Presentation: Calling JavaBeans
JSP Pages and Alternative Markup Languages
Overview of JSP Syntax Elements
Directives
page directive
include directive
taglib directive
Scripting Elements
Declarations
Expressions
Scriptlets
Comments
JSP Objects and Scopes
Explicit Objects
Implicit Objects
Using an Implicit Object
Object Scopes
Standard Actions: JSP Tags
jsp:useBean tag
jsp:setProperty tag
jsp:getProperty tag
jsp:param tag
jsp:include tag
jsp:forward tag
jsp:plugin tag
Bean Property Conversions from String Values
Typical Property Conversions
Conversions for Property Types with Property Editors
Custom Tag Libraries
JSP Execution
JSP Containers in a Nutshell
JSP Execution Models
On-Demand Translation Model
Pretranslation Model
JSP Pages and On-Demand Translation
Requesting a JSP Page
Directly Requesting a JSP Page
Indirectly Requesting a JSP Page

2 Overview of the Oracle JSP Implementation

Overview of the Oracle Application Server and JSP Support
Overview of the Oracle Application Server
Oracle HTTP Server and mod_oc4j
Overview of OC4J
OC4J General Features
OC4J Services
OC4J Containers
OC4J Standalone
Overview of the JSP Implementation in OC4J
History and Integration of JSP Containers
JSP Front-End Servlet and Configuration
OC4J JSP Features for JSP 1.2
Configurable JSP Extensions in OC4J
Portability Across Servlet Environments
Oracle JDeveloper JSP Support
Overview of Oracle Value-Added Features
Summary of Tag Libraries and Utilities Provided with OC4J
Overview of Oracle-Specific Features
Global Includes
Support for Dynamic Monitoring Service
Enhanced Servlet 2.0 Support
Overview of Tags and API for Caching Support
Support for the JavaServer Pages Standard Tag Library

3 Getting Started

Some Initial Considerations
Application Root Functionality
Classpath Functionality
Runtime Retranslation or Reloading
JSP Compilation Considerations
JSP Security Considerations
JSP Performance Considerations
Programmatic Considerations for Optimization
Configuration Optimizations
The ojspc Utility for Pretranslation
Additional OC4J and Oracle Application Server Performance Features
Default Package Imports
JSP File Naming Conventions
Removal of tools.jar from OC4J Standalone
JDK 1.4 Considerations: Cannot Invoke Classes Not in Packages
Key Support Files Provided with OC4J
JSP Configuration in OC4J
JSP Container Setup
JSP Configuration Parameters
JSP Configuration Parameter Summary Table
JSP Configuration Parameter Descriptions
Setting JSP Configuration Parameters in OC4J
OC4J Configuration Parameters for JSP
JSP-Related OC4J Configuration Parameter Descriptions
Setting JSP-Related OC4J Configuration Parameters
Key OC4J Configuration Files
JSP Configuration in Oracle Enterprise Manager 10g
Application Server Control Console JSP Properties Page
Configuration Parameters Supported by the JSP Properties Page
Configuration Parameters Not Supported by the JSP Properties Page

4 Basic Programming Considerations

JSP-Servlet Interaction
Invoking a Servlet from a JSP Page
Passing Data to a Servlet Invoked from a JSP Page
Invoking a JSP Page from a Servlet
Passing Data Between a JSP Page and a Servlet
JSP-Servlet Interaction Samples
Code for Jsp2Servlet.jsp
Code for MyServlet.java
Code for welcome.jsp
JSP Data-Access Support and Features
Introduction to JSP Support for Data Access
JSP Data-Access Sample Using JDBC
Use of JDBC Performance Enhancement Features
Database Connection Caching
JDBC Statement Caching
Update Batching
Row Prefetching
Rowset Caching
EJB Calls from JSP Pages
Overview of Configuration and Deployment for EJBs
Code Steps and Approaches for EJB Calls
Use of the OC4J EJB Tag Library
OracleXMLQuery Class
JSP Resource Management
Standard Session Resource Management: HttpSessionBindingListener
The valueBound() and valueUnbound() Methods
JDBCQueryBean JavaBean Code
UseJDBCQueryBean JSP Page
Advantages of HttpSessionBindingListener
Overview of Oracle Value-Added Features for Resource Management
Runtime Error Processing
Servlet and JSP Runtime Error Mechanisms
General Servlet Runtime Error Mechanism
JSP Error Pages
JSP Error Page Example
Code for nullpointer.jsp
Code for myerror.jsp

5 JSP XML Support

JSP XML Documents and JSP XML View: Overview and Comparison
Details of JSP XML Documents
Summary Table of JSP XML Syntax
JSP XML root Element and JSP XML Namespaces
JSP XML Directive Elements
Example: page Directive
Example: include Directive
JSP XML Declaration, Expression, and Scriptlet Elements
Example: JSP Declaration
Example: JSP Expression
Example: JSP Scriptlet
JSP XML Standard Action and Custom Action Elements
JSP XML Text Elements and Other Elements
Example: Other JSP XML Elements
Sample Comparison: Traditional JSP Page Versus JSP XML Document
Sample Traditional JSP Page
Sample JSP XML Document
Details of the JSP XML View
Transformation from a JSP Page to the XML View
The jsp:id Attribute for Error Reporting During Validation
Example: Transformation from Traditional JSP Page to XML View
Traditional JSP Page
XML View of JSP Page

6 Additional Programming Considerations

General JSP Programming Strategies
JavaBeans Versus Scriptlets
Static Includes Versus Dynamic Includes
Logistics of Static Includes
Logistics of Dynamic Includes
Advantages, Disadvantages, and Typical Uses of Dynamic and Static Includes
When to Consider Creating and Using JSP Tag Libraries
Replacing Java Syntax
Providing Convenient JSP Programming Access to API Features
Manipulating or Redirecting JSP Output
Additional JSP Programming Tips
Hiding JSP Pages from Direct Invocation
Use of a Central Checker Page
Workarounds for Large Static Content or Significant Tag Library Usage
Method Variable Declarations Versus Member Variable Declarations
Page Directive Characteristics
Page Directives Are Static
Duplicate Settings of Page Directive Attributes Are Disallowed
Page Directive import Settings Are Cumulative
JSP Preservation of White Space and Use with Binary Data
White Space Examples
Reasons to Avoid Binary Data in JSP Pages

7 JSP Translation and Deployment

Functionality of the JSP Translator
Features of Generated Code
Features of Page Implementation Class Code
Member Variables for Static Text
General Conventions for Output Names
Generated Package and Class Names
Package Naming
Class Naming
Generated Files and Locations
Files Generated by the JSP Translator
JSP Translator Output File Locations
Issues in the Current Release
Oracle JSP Global Includes
The ojsp-global-include.xml File
Global Include Examples
The ojspc Pretranslation Utility
Overview of Basic ojspc Functionality
Overview of ojspc Batch Pretranslation
Option Summary Table for ojspc
Command-Line Syntax for ojspc
Option Descriptions for ojspc
-addclasspath
-appRoot
-batchMask
-deleteSource
-dir
-extend
-extraImports
-extres
-forgiveDupDirAttr
-help
-implement
-noCompile
-noTldXmlValidate
-oldIncludeFromTop
-output
-packageName
-reduceTagCode
-reqTimeIntrospection
-srcdir
-staticTextInChars
-tagReuse
-verbose
-version
-xmlValidate
Summary of ojspc Output Files, Locations, and Related Options
JSP Deployment Considerations
Overview of EAR/WAR Deployment
OC4J Deployment Features
Standard WAR Deployment
Application Deployment with Oracle JDeveloper
JSP Pretranslation
Techniques for Page Pretranslation with ojspc
Batch Pretranslation with ojspc
Standard JSP Pretranslation without Execution
Deployment of Binary Files Only
Archiving and Deploying the Binary Files
Configuring the OC4J JSP Container for Execution with Binary Files Only

8 JSP Tag Libraries

Overview of the Tag Library Framework
Overview of a Custom Tag Library Implementation
Overview of Tag Library Changes Between the JSP 1.1 and 1.2 Specifications
Summary of TLD File Changes Between the JSP 1.1 and 1.2 Specifications
Summary of Tag Handler Changes Between the JSP 1.1 and 1.2 Specifications
Tag Library Descriptor Files
Overview of TLD File Validation and Features
Use of the tag Element
Subelements of the tag Element
Sample tag Element and Use of Its body-content Subelement
Other Key Elements and Their Subelements: validator and listener
Tag Library and TLD Setup and Access
Overview: Specifying a Tag Library with the taglib Directive
Specifying a Tag Library by Physical Location
Packaging and Accessing Multiple Tag Libraries in a JAR File
Example: URI Settings for Multiple Tag Libraries in a JAR File
Use of web.xml for Tag Libraries
Oracle Extensions for Tag Library Sharing and Persistent TLD Caching
TLD Caching and Well-Known Tag Library Locations
TLD Cache Features and Files
Example: Multiple Tag Libraries and TLD Files in a JAR File
Key TLD File Entries for Multiple-Library Example
Key web.xml File Entries for Multiple-Library Example
JSP Page taglib Directives for Multiple-Library Example
Tag Handlers
Overview of Tag Handlers
Attribute Handling, Conversions from String Values
Custom Tag Processing, with or without Tag Bodies
Summary of Integer Constants for Body Processing
Simple Tag Handlers without Iteration
Simple Tag Handlers with Iteration
Tag Handlers That Access Body Content
BodyTag Features
BodyContent Objects
TryCatchFinally Interface
Access to Outer Tag Handler Instances
OC4J JSP Tag Handler Features
Disabling or Enabling Runtime or Compile-Time Tag Handler Reuse
Key Points Regarding Tag Handler Reuse
Enabling or Disabling the Runtime Model for Tag Handler Reuse
Enabling or Disabling the Compile-Time Model for Tag Handler Reuse
Tag Handler Code Generation
Scripting Variables, Declarations, and Tag-Extra-Info Classes
Using Scripting Variables
Scripting Variable Scopes
Variable Declaration Through TLD variable Elements
Variable Declaration Through Tag-Extra-Info Classes
Validation and Tag-Library-Validator Classes
TLD validator Element
Example 1
Example 2
Key TLV-Related Classes and the validation() Method
TLV Processing
Validation Mechanisms
Tag Library Event Listeners
TLD listener Element
Activation of Tag Library Event Listeners
Access of TLD Files for Event Listener Information
End-to-End Custom Tag Examples
Example: Using the IterationTag Interface
Sample JSP Page: exampleiterator.jsp
Sample Tag Handler Class: MyIteratorTag.java
Sample Tag Library Descriptor File: exampleiterator.tld
Example: Using the IterationTag Interface and a Tag-Extra-Info Class
Sample JSP Page: exampletag.jsp
Sample Tag Handler Class: ExampleLoopTag.java
Sample Tag-Extra-Info Class: ExampleLoopTagTEI.java
Sample Tag Library Descriptor File: exampletag.tld
Compile-Time Tags
General Compile-Time Versus Runtime Considerations
JSP Compile-Time Versus Runtime JML Library

9 JSP Globalization Support

Content Type Settings
Content Type Settings in the page Directive
Dynamic Content Type Settings
Oracle Extension for the Character Set of the JSP Writer Object
JSP Support for Multibyte Parameter Encoding
Standard setCharacterEncoding() Method
Overview of Oracle Extensions for Older Servlet Environments

A Servlet and JSP Technical Background

Background on Servlets
Review of Servlet Technology
The Servlet Interface
Servlet Containers
Servlet Sessions
HttpSession Interface
Session Tracking
Servlet Contexts
Application Lifecycle Management Through Event Listeners
Servlet Invocation
Web Application Hierarchy
Standard JSP Interfaces and Methods

B Third Party Licenses

Apache HTTP Server
The Apache Software License

Index