Thursday, 7 February 2013

Compatibility with Java Servlet Specification Version 2.3 | Servlets Tutorial pdf

Compatibility with Java Servlet Specification Version 2.3

This section describes the compatibility issues introduced in this version of the specification.
 HttpSessionListener.sessionDestroyed
In the previous versions of the specification, this method was defined as:
Notification that a session was invalidated.
As of Version 2.4, this method is changed to:
1. Please see the JavaTM 2 Platform, Enterprise Edition specification available
at http://java.sun.com/j2ee/
OVERVIEW
Notification that a session is about to be invalidated
so that it notifies before the session invalidation. If the code assumed the previous behavior, it must be modified to match the new behavior.
ServletRequest methods getRemotePort, getLocalName, getLocalAddr, getLocaPort
The following methods are added in the ServletRequest interface in this version of the specification.
public int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
public java.lang.String getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.
public java.lang.String getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.
public int getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.
Be aware that this addition causes source incompatibility in some cases, such as when a developer implements the ServletRequest interface. In this case, ensure that all the new methods are implemented.

No comments: