InfoCenter Home >
3: Migration overview >
3.3: Migrating APIs and specifications >
3.3.2a: New Servlet Engine option for migrating applications to Servlet 2.2
3.3.2a: New Servlet Engine option for migrating applications to Servlet 2.2
WebSphere Application Server version 3.5.2 maintains compatibility with
existing applications while simultaneously supporting the Java Servlet API 2.2 specification.
To ensure compatibility, a new option was added to Servlet Engine properties in the
Administrative console.
This new option, the Select Servlet Engine Mode, is
located on the Servlet Engine properties view.
The Select Servlet Engine Mode
option toggles between the following two different "runtime" modes:
- WebSphere Application Server 3.5 Compatibility Mode which maintains
behavior with existing WebSphere Application Server V3.5 and V3.5.1 applications at the expense of full compliance with the Java Servlet API 2.2 specification.
Note: In compatibility mode, the Servlet Engine is Servlet 2.2 specification level compliant except for the method and
behavior changes noted below. This capability is provided to allow existing WebSphere Application Server
V3.5 and V3.5.1 applications to successfully execute until they are migrated to fully
compliant Servlet 2.2 level applications.
- Full Servlet 2.2 Compliance Mode which maintains compliance with the
Java Servlet API 2.2 specification at the expense of compatibility with existing
WebSphere Application Server V3.5 and V3.5.1 applications.
The default mode is the Compatibility Mode.
You select your desired mode using the Administrative Console, Servlet Engine "General" tab.
Mode differences
The following table describes how the Select Servlet Engine Mode setting affects Servlet API methods
and various behaviors.
Warning: Specifying compliance mode for existing
WebSphere Application Server V3.5 and V3.5.1 applications may generate incorrect results.
Type |
Methods/ Behaviors |
Compatibility mode |
Compliance mode |
API Methods |
getCharacterEncoding() method |
If the client request did not send any character encoding data, the default
encoding of the server JVM is returned. |
If the client request did not send any character encoding data, null
is returned. |
getMimeType() method |
If the file extension does not map to a valid mime type,
the mime type www/unknown is returned. |
If the file extension does not map to a valid mime type,
null is returned. |
Behaviors |
Default content type on response buffer reset |
On response buffer reset, the content type of the request is
reset to text/html. |
On response buffer reset, the content type is
cleared and and not set to a default value. |
HTTP Session scoping |
Values placed in the HTTP Session object have a global scope, across
all Web applications. |
Values placed in the HTTP Session object have a scope limited
to the Web application that created the value. |
Request mapping behavior |
- Exact mapping is not supported.
- Wildcard mapping is an implied wildcard.
That is, /Servlet really means /Servlet*.
- Any URL pattern specified without /* on the end is assumed to be a wildcard
rule, and /* is added in the Servlet runtime.
- Any URL pattern provided with /* on the end is accepted and used as is.
|
- The servlet specification pattern mapping logic is followed, including
support for exact matches.
- To specify the URL, the Servlet 2.2 specification allows the following syntax:
- A string beginning with / and ending with /*
specifies a wildcard match.
- A string beginning with *. specifies an extension mapping.
- All other strings are used as exact matches.
- The Servlet 2.2 specification indicates how requests for resources are mapped to the
appropriate resources. Mapping occurs in the following order:
- exact match
- longest wildcard match
- matching extension
- default servlet (defined by / URL).
|
Auto-Invoker |
The default invoker's URL is:
/servlet/ |
The default invoker's URL is:
/servlet/* |
|
|