Skip Headers
Oracle® Containers for J2EE Support for JavaServer Pages Developer's Guide
10
g
Release 3 (10.1.3)
Part No. B14430-01
Home
Solution Area
Index
Next
Contents
Title and Copyright Information
Preface
Intended Audience
Documentation Accessibility
Related Documents
Conventions
1
Getting Started with JSP
1.1
A Brief Overview of JavaServer Pages Technology
1.1.1
What is JavaServer Pages Technology?
1.1.2
Key Advantages of JSP
1.1.3
How JSP Works
1.1.4
JSP Translation and Runtime Flow
1.2
Overview of JSP Syntax Elements
1.2.1
Directives
1.2.1.1
page directive
1.2.1.2
include directive
1.2.1.3
taglib directive
1.2.2
Scripting Elements
1.2.2.1
Declarations
1.2.2.2
Expressions
1.2.2.3
Scriptlets
1.2.2.4
Comments
1.2.3
JSP Objects and Scopes
1.2.3.1
Explicit Objects
1.2.3.2
Implicit Objects
1.2.3.3
Using an Implicit Object
1.2.3.4
Object Scopes
1.2.4
Standard JSP Action Tags
1.2.4.1
jsp:useBean tag
1.2.4.2
jsp:setProperty tag
1.2.4.3
jsp:getProperty tag
1.2.4.4
jsp:param tag
1.2.4.5
jsp:include tag
1.2.4.6
jsp:forward tag
1.2.4.7
jsp:plugin tag
1.2.5
Bean Property Conversions from String Values
1.2.5.1
Typical Property Conversions
1.2.5.2
Conversions for Property Types with Property Editors
1.2.6
Custom Tag Libraries
1.3
Simplified JSP Authoring with the Expression Language
1.3.1
Overview of the Expression Language Syntax
1.3.1.1
JSP Expression Language Syntax
1.3.1.2
Expression Language Implicit Objects
1.3.1.3
Additional Features of the Expression Language
1.3.2
Creating and Using Expression Language Functions
1.3.3
Disabling the Expression Language
1.3.3.1
Disabling EL in All JSPs in a Web Application
1.3.3.2
Disabling EL in a JSP
1.3.3.3
Disabling EL in a Tag File
1.4
JSP Execution Model
1.4.1
JSP Execution Models
1.4.1.1
On-Demand Translation Model
1.4.1.2
Pretranslation Model
1.4.2
JSP Pages and On-Demand Translation
1.4.3
Requesting a JSP Page
1.4.3.1
Directly Requesting a JSP Page
1.4.3.2
Indirectly Requesting a JSP Page
2
The Oracle JSP Implementation
2.1
Introduction to OC4J
2.1.1
What's New in OC4J
2.1.1.1
Support for Web Services
2.1.1.2
Support for New J2EE 1.4 Application Management and Deployment Specifications
2.1.1.3
Support for Oracle Application Server TopLink
2.1.1.4
OracleAS Job Scheduler
2.1.1.5
New Two-Phase Commit Transaction Coordinator Functionality
2.1.1.6
Generic JMS Resource Adapter Enhancements
2.1.2
Features of OC4J
2.1.2.1
J2EE Support
2.1.2.2
OC4J Web Communication
2.1.2.3
Clustering
2.2
Oracle Value-Added Features for JSP
2.2.1
Supported Specifications
2.2.2
Oracle-Specific Features
2.2.2.1
Configurable JSP Extensions in OC4J
2.2.2.2
Global Includes
2.2.2.3
Support for Dynamic Monitoring Service
2.2.3
JSP Utilities and Tag Libraries Provided with OC4J
2.2.4
Tags and API for Caching Support
2.2.5
Support for the JavaServer Pages Standard Tag Library (JSTL)
2.3
JSP Support in Oracle JDeveloper
2.4
Oracle JSP Resource Management Features
2.4.1
Standard Session Resource Management: HttpSessionBindingListener
2.4.1.1
The valueBound() and valueUnbound() Methods
2.4.1.2
JDBCQueryBean JavaBean Code
2.4.1.3
UseJDBCQueryBean JSP Page
2.4.1.4
Advantages of HttpSessionBindingListener
2.4.2
Overview of Oracle Value-Added Features for Resource Management
3
Configuring the OC4J JSP Environment
3.1
Configuring the OC4J JSP Container
3.1.1
Summary of JSP Configuration Parameters
3.1.2
Setting JSP Parameters in Application Server Control Console
3.1.2.1
Accessing Application Server Control Console in Standalone OC4J
3.1.2.2
Accessing Application Server Control Console in Oracle Application Server
3.1.3
Setting JSP Parameters in the XML Configuration Files
3.1.3.1
Setting Servlet Initialization Paramters
3.1.3.2
Setting JSP Configuration Parameters
3.2
Configuring JSP Compilation in OC4J
3.3
Configuring Runtime JSP Retranslation and Reloading in OC4J
3.4
Key JSP-Related Support Files Provided with OC4J
4
Precompiling JSPs with ojspc
4.1
How the ojspc Utility Works
4.1.1
Overview of Basic ojspc Functionality
4.1.2
Overview of Batch Pretranslation of WAR Files
4.2
Using ojspc
4.3
Precompiling One or More JSPs
4.4
Precompiling JSPs within a WAR File
4.5
Complete Summary of ojspc Command Line Options
5
Understanding JSP Translation in OC4J
5.1
Features of Generated Code
5.2
General Conventions for Output Names
5.3
Generated Package and Class Names
5.4
Generated Files and Locations
5.5
Oracle JSP Global Includes
5.5.1
Global Includes File and Examples
5.5.1.1
The ojsp-global-include.xml File
5.5.1.2
Global Include Examples
6
Working with JSP
6.1
Before You Start
6.1.1
Understanding Application Root Functionality
6.1.2
Understanding OC4J Classpath Functionality
6.1.3
Packages Imported By Default in OC4J
6.1.4
JDK1.4 Issue: Classes Not in Packages Cannot Be Invoked
6.2
General JSP Programming Strategies
6.2.1
Creating Traditional Versus Scriptless JSP
6.2.2
Using JavaBeans Versus Scriptlets
6.2.3
Using Static Includes Versus Dynamic Includes
6.2.3.1
Logistics of Static Includes
6.2.3.2
Logistics of Dynamic Includes
6.2.3.3
Advantages, Disadvantages, and Typical Uses of Dynamic and Static Includes
6.2.4
Monitoring Your JSP Application
6.2.5
Managing Heavy Static Content or Tag Library Usage
6.2.6
Using Method Variable Declarations Versus Member Variable Declarations
6.2.7
Working with Page Directives
6.2.7.1
Page Directives Are Static
6.2.7.2
Duplicate Settings of Page Directive Attributes Are Disallowed
6.2.8
Workarounds for the 64K Size Limit for Generated Methods
6.2.9
Following JSP File Naming Conventions
6.2.10
Understanding JSP Preservation of White Space and Use with Binary Data
6.2.10.1
White Space Examples
6.2.10.2
Reasons to Avoid Binary Data in JSP Pages
6.3
JSP Best Practices
6.3.1
Beware of HTTP Sessions
6.3.1.1
Avoid Using HTTP Sessions If Not Required
6.3.1.2
Always Invalidate Sessions When No Longer In Use
6.3.2
Pre-translate JSP Pages Using the ojspc Utility
6.3.3
Ensure Updated Objects Are Re-set on HTTP Sessions
6.3.4
Un-Buffer JSP Pages
6.3.5
Forward to JSP Pages Instead of Using Redirects
6.3.6
Hide JSP Pages from Direct Invocation to Limit Access
6.3.7
Use JSP-Timeout for Efficient Memory Utilization
6.3.8
Package JSP Files In EAR File For Deployment
6.4
Working with Servlets
6.4.1
Invoking a Servlet from a JSP Page
6.4.2
Passing Data to a Servlet Invoked from a JSP Page
6.4.3
Invoking a JSP Page from a Servlet
6.4.4
Passing Data Between a JSP Page and a Servlet
6.4.5
JSP-Servlet Interaction Samples
6.4.5.1
Code for Jsp2Servlet.jsp
6.4.5.2
Code for MyServlet.java
6.4.5.3
Code for welcome.jsp
6.5
Processing Runtime Errors
6.5.1
Servlet and JSP Runtime Error Mechanisms
6.5.1.1
General Servlet Runtime Error Mechanism
6.5.1.2
JSP Error Pages
6.5.2
JSP Error Page Example
6.5.2.1
Code for nullpointer.jsp
6.5.2.2
Code for myerror.jsp
7
Working with Custom Tags
7.1
What Are Custom Tags?
7.1.1
Available Tag Libraries
7.1.2
When Should You Consider Creating/Using Custom Tag Libraries?
7.1.2.1
Eliminating Extensive Java Logic
7.1.2.2
Providing Convenient JSP Programming Access to API Features
7.1.2.3
Manipulating or Redirecting JSP Output
7.2
Working with Tag Handlers
7.2.1
What Are Classic Tag Handlers?
7.2.1.1
Classic Tag Handler Interfaces
7.2.1.2
Custom Tag Processing, with or without Tag Bodies
7.2.1.3
Tag Handlers That Access Body Content
7.2.2
What Are Simple Tag Handlers?
7.2.2.1
The SimpleTag Interface
7.2.2.2
Using Attributes
7.2.3
Attribute Handling and Conversions from String Values in Tag Handlers
7.2.4
Using Scripting Variables in Tags
7.2.4.1
Scripting Variable Scopes
7.2.4.2
Variable Declaration Through TLD variable Elements
7.2.4.3
Variable Declaration Through Tag-Extra-Info Classes
7.2.5
Access to Outer Tag Handler Instances
7.2.6
Implementing a Tag Handler
7.2.6.1
Creating the Tag Handler Class
7.2.6.2
Defining the Tag in the TLD
7.2.6.3
Declaring the Tag in a JSP Page
7.2.6.4
Using the Tag in a JSP
7.3
OC4J Tag Handler Features
7.3.1
Disabling or Enabling Tag Handler Reuse (Tag Pooling)
7.3.1.1
Enabling or Disabling the Compile-Time Model for Tag Handler Reuse
7.3.1.2
When Can the Compile-Time Tag Pooling Model Be Used?
7.3.1.3
Code Pattern for the compiletime Tag Pooling Model
7.3.1.4
Code Pattern for the compiletime-with-release Tag Pooling Model
7.3.2
Tag Handler Code Generation
7.4
Working with Tag Files
7.4.1
What Are Tag Files?
7.4.2
Tag Body Processing
7.4.3
Using Attributes in Tag Files
7.4.4
Exposing Data through Variables in Tag Files
7.4.5
Using JSP Fragments
7.4.5.1
Creating a JSP Fragment
7.4.5.2
A Tag File Example
7.4.6
Implementing a Tag File
7.4.6.1
Creating the Tag File
7.4.6.2
Packaging Tag Files
7.4.6.3
Declaring the Tag File in a JSP
7.5
Sharing Tag Libraries Across Web Applications
7.5.1
Packaging Multiple Tag Libraries and TLD Files in a JAR File
7.5.1.1
Key TLD File Entries
7.5.1.2
Key web.xml Deployment Descriptor Entries
7.5.1.3
JSP Page taglib Directives for Multiple-Library Example
7.5.2
Specifying Well-Known Tag Library Locations
7.5.3
Enabling the TLD Caching Feature
7.5.3.1
Understanding the TLD Cache Features and Files
8
Understanding JSP XML Support in OC4J
8.1
Introducing JSP Documents and XML Views
8.2
Working with JSP Documents
8.2.1
Specifying a Document Root Element
8.2.2
Declaring Tag Libraries with XML Namespaces
8.2.3
Using JSP XML Directive Elements
8.2.3.1
Example: page Directive
8.2.3.2
Example: include Directive
8.2.4
Using JSP XML Declaration, Expression, and Scriptlet Elements
8.2.4.1
Example: JSP Declaration
8.2.4.2
Example: JSP Expression
8.2.4.3
Example: JSP Scriptlet
8.2.5
Using JSP XML Standard Action and Custom Action Elements
8.2.6
Including Template and Dynamic Template Content
8.2.7
Sample Comparison: Traditional JSP Page Versus JSP XML Document
8.2.7.1
Sample Traditional JSP Page
8.2.7.2
Sample JSP Document
8.3
Understanding the JSP XML View
8.3.1
Transformation from a JSP Page to the XML View
8.3.2
The jsp:id Attribute for Error Reporting During Validation
8.3.3
Example: Transformation from Traditional JSP Page to XML View
8.3.3.1
Traditional JSP Page
8.3.3.2
XML View of JSP Page
9
JSP Globalization Support in Oracle
9.1
Content Type Settings
9.1.1
Content Type Settings in the page Directive
9.1.2
Dynamic Content Type Settings
9.1.3
Oracle Extension for the Character Set of the JSP Writer Object
9.2
JSP Support for Multibyte Parameter Encoding
9.2.1
Standard setCharacterEncoding() Method
A
Third Party Licenses
A.1
Apache
A.1.1
The Apache Software License
A.1.1.1
License
A.1.1.2
Notice
Index