Developing Web Applications, Servlets, and JSPs for WebLogic Server

     Previous  Next    Contents  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Introduction and Roadmap

Document Scope and Audience

Guide to this Document

Related Documentation

Examples for the Web Application Developer

Avitek Medical Records Application (MedRec)

Web Application Examples in the WebLogic Server Distribution

New and Changed Features In This Release

WebApp Libraries

JSF and JSTL Libraries

Using Two-Way SSL With Generic Proxy Servlets

Servlet Authentication Fallback Mechanism

Future Response Model for HTTP Servlets

Deprecated Features

Understanding Web Applications, Servlets, and JSPs

The Web Applications Container

Servlets

What You Can Do with Servlets

Servlet Development Key Points

Servlets and J2EE

Java Server Pages

What You Can Do with JSPs

Overview of How JSP Requests Are Handled

JSPs and J2EE

Web Application Developer Tools

Ant Tasks to Create Skeleton Deployment Descriptors

XML Editors

Web Application Security

P3P Privacy Protocol

Displaying Special Characters on Linux Browsers

Creating and Configuring Web Applications

Directory Structure

Accessing Information in WEB-INF

Directory Structure Example

Main Steps to Create and Configure a Web Application

Step One: Create the Enterprise Application Wrapper

Step Two: Create the Web Application

Step Three: Creating the build.xml File

Step Four: Execute the Split Development Directory Structure Ant Tasks

Configuring How a Client Accesses a Web Application

Configuring Virtual Hosts for Web Applications

Configuring a Channel-based Virtual Host

Configuring a Host-based Virtual Host

Targeting Web Applications to Virtual Hosts

Loading Servlets, Context Listeners, and Filters

Shared J2EE Web Application Libraries

Using JSF and JSTL With Web Applications

Creating and Configuring Servlets

Configuring Servlets

Servlet Mapping

Setting Up a Default Servlet

Servlet Initialization Attributes

Writing a Simple HTTP Servlet

Advanced Features

Complete HelloWorldServlet Example

Creating and Configuring JSPs

Configuring Java Server Pages (JSPs)

Registering a JSP as a Servlet

Configuring JSP Tag Libraries

Configuring Welcome Files

Customizing HTTP Error Responses

Determining the Encoding of an HTTP Request

Mapping IANA Character Sets to Java Character Sets

Configuring Implicit Includes at the Beginning and End of JSPs

Configuring JSP Property Groups

JSP Property Group Rules

What You Can Do with JSP Property Groups

Writing JSP Documents Using XML Syntax

How to Use JSP Documents

Important Information about JSP Documents

Configuring Resources in a Web Application

Configuring Resources in a Web Application

Configuring Resources

Referencing External EJBs

More about the ejb-ref* Elements

Referencing Application-Scoped EJBs

Serving Resources from the CLASSPATH with the ClasspathServlet

Using CGI with WebLogic Server

Configuring WebLogic Server to Use CGI

Requesting a CGI Script

CGI Best Practices

Servlet Programming Tasks

Initializing a Servlet

Initializing a Servlet when WebLogic Server Starts

Overriding the init() Method

Providing an HTTP Response

Retrieving Client Input

Methods for Using the HTTP Request

Example: Retrieving Input by Using Query Parameters

Securing Client Input in Servlets

Using a WebLogic Server Utility Method

Using Cookies in a Servlet

Setting Cookies in an HTTP Servlet

Retrieving Cookies in an HTTP Servlet

Using Cookies That Are Transmitted by Both HTTP and HTTPS

Application Security and Cookies

Response Caching

Initialization Parameters

Using WebLogic Services from an HTTP Servlet

Accessing Databases

Connecting to a Database Using a DataSource Object

Using a DataSource in a Servlet

Connecting Directly to a Database Using a JDBC Driver

Threading Issues in HTTP Servlets

Dispatching Requests to Another Resource

Forwarding a Request

Including a Request

RequestDispatcher and Filters

Proxying Requests to Another Web Server

Overview of Proxying Requests to Another Web Server

Setting Up a Proxy to a Secondary Web Server

Sample Deployment Descriptor for the Proxy Servlet

Clustering Servlets

Referencing a Servlet in a Web Application

URL Pattern Matching

The SimpleApacheURLMatchMap Utility

A Future Response Model for HTTP Servlets

Abstract Asynchronous Servlet

doRequest

doResponse

doTimeOut

Future Response Servlet

Using Sessions and Session Persistence

Overview of HTTP Sessions

Setting Up Session Management

HTTP Session Properties

Session Timeout

Configuring WebLogic Server Session Cookies

Configuring Application Cookies That Outlive a Session

Logging Out and Ending a Session

Enabling Web applications to share the same session

Configuring Session Persistence

Attributes Shared by Different Types of Session Persistence

Using Memory-based, Single-server, Non-replicated Persistent Storage

Using File-based Persistent Storage

Using a Database for Persistent Storage (JDBC persistence)

Configuring JDBC-based Persistent Storage

Caching and Database Updates for JDBC Session Persistence

Using Cookie-Based Session Persistence

Using URL Rewriting Instead of Cookies

Coding Guidelines for URL Rewriting

URL Rewriting and Wireless Access Protocol (WAP)

Session Tracking from a Servlet

A History of Session Tracking

Tracking a Session with an HttpSession Object

Lifetime of a Session

How Session Tracking Works

Detecting the Start of a Session

Setting and Getting Session Name/Value Attributes

Logging Out and Ending a Session

Using session.invalidate() for a Single Web Application

Implementing Single Sign-On for Multiple Applications

Exempting a Web Application for Single Sign-on

Configuring Session Tracking

Using URL Rewriting Instead of Cookies

URL Rewriting and Wireless Access Protocol (WAP)

Making Sessions Persistent

Scenarios to Avoid When Using Sessions

Use Serializable Attribute Values

Configuring Session Persistence

Configuring a Maximum Limit on In-memory Servlet Sessions

Enabling Session Memory Overload Protection

Application Events and Event Listener Classes

Overview of Application Event Listener Classes

Servlet Context Events

HTTP Session Events

Servlet Request Events

Configuring an Event Listener Class

Writing an Event Listener Class

Templates for Event Listener Classes

Servlet Context Event Listener Class Example

HTTP Session Attribute Event Listener Class Example

Additional Resources

WebLogic JSP Reference

JSP Tags

Reserved Words for Implicit Objects

Directives for WebLogic JSP

Using the page Directive to Set Character Encoding

Using the taglib Directive

Declarations

Scriptlets

Expressions

Example of a JSP with HTML and Embedded Java

Actions

Using JavaBeans in JSP

Instantiating the JavaBean Object

Doing Setup Work at JavaBean Instantiation

Using the JavaBean Object

Defining the Scope of a JavaBean Object

Forwarding Requests

Including Requests

JSP Expression Language

Expressions and Attribute Values

Expressions and Template Text

JSP Expression Language Implicit Objects

JSP Expression Language Literals and Operators

Literals

Errors, Warnings, Default Values

Operators

Operator Precedence

JSP Expression Language Reserved Words

JSP Expression Language Named Variables

Securing User-Supplied Data in JSPs

Using a WebLogic Server Utility Method

Using Sessions with JSP

Deploying Applets from JSP

Using the WebLogic JSP Compiler

JSP Compiler Syntax

JSP Compiler Options

Precompiling JSPs

Using the JSPClassServlet

Filters

Overview of Filters

How Filters Work

Uses for Filters

Writing a Filter Class

Configuring Filters

Configuring a Filter

Configuring a Chain of Filters

Filtering the Servlet Response Object

Additional Resources

Using WebLogic JSP Form Validation Tags

Overview of WebLogic JSP Form Validation Tags

Validation Tag Attribute Reference

<wl:summary>

<wl:form>

<wl:validator>

Using WebLogic JSP Form Validation Tags in a JSP

Creating HTML Forms Using the <wl:form> Tag

Defining a Single Form

Defining Multiple Forms

Re-Displaying the Values in a Field When Validation Returns Errors

Re-Displaying a Value Using the <input> Tag

Re-Displaying a Value Using the Apache Jakarta <input:text> Tag

Using a Custom Validator Class

Extending the CustomizableAdapter Class

Sample User-Written Validator Class

Sample JSP with Validator Tags

Using Custom WebLogic JSP Tags (cache, process, repeat)

Overview of WebLogic Custom JSP Tags

Using the WebLogic Custom Tags in a Web Application

Cache Tag

Refreshing a Cache

Flushing a Cache

Process Tag

Repeat Tag

Using the WebLogic EJB to JSP Integration Tool

Overview of the WebLogic EJB-to-JSP Integration Tool

Basic Operation

Interface Source Files

Build Options Panel

Troubleshooting

Using EJB Tags on a JSP Page

EJB Home Methods

Stateful Session and Entity Beans

Default Attributes

web.xml Deployment Descriptor Elements

web.xml Namespace Declaration and Schema Location

icon

display-name

description

distributable

context-param

filter

filter-mapping

listener

servlet

icon

init-param

security-role-ref

servlet-mapping

session-config

mime-mapping

welcome-file-list

error-page

jsp-config

taglib

jsp-property-group

resource-env-ref

resource-ref

security-constraint

web-resource-collection

auth-constraint

user-data-constraint

login-config

form-login-config

security-role

env-entry

ejb-ref

ejb-local-ref

web-app

weblogic.xml Deployment Descriptor Elements

weblogic.xml Namespace Declaration and Schema Location

description

weblogic-version

security-role-assignment

run-as-role-assignment

resource-description

resource-env-description

ejb-reference-description

service-reference-description

session-descriptor

jsp-descriptor

auth-filter

container-descriptor

check-auth-on-forward

filter-dispatched-requests-enabled

redirect-with-absolute-url

index-directory-enabled

index-directory-sort-by

servlet-reload-check-secs

resource-reload-check-secs

single-threaded-servlet-pool-size

session-monitoring-enabled

save-sessions-enabled

prefer-web-inf-classes

default-mime-type

client-cert-proxy-enabled

relogin-enabled

allow-all-roles

native-io-enabled

minimum-native-file-size

disable-implicit-servlet-mapping

optimistic-serialization

require-admin-traffic

charset-params

input-charset

charset-mapping

virtual-directory-mapping

url-match-map

security-permission

context-root

wl-dispatch-policy

servlet-descriptor

work-manager

logging

library-ref

Backwards Compatibility Flags

Web Container Global Configuration

Web Application Best Practices

CGI Best Practices

Servlet Best Practices

JSP Best Practices

Best Practice When Subclassing ServletResponseWrapper


  Back to Top       Previous  Next