NonStop Servlets for JavaServer Pages (5.0) System Administrator's Guide

Migrating to NSJSP 5.0
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide525644-002
7-10
Changes from Servlet 2.3 to Servlet 2.4
Note that these attributes are not set for forwarded servlets and JSPs obtained
using the getNamedDispatcher() method.
The ServletRequest and ServletRequestWrapper classes have four new
methods to return information about the IP connection.
getLocalPort(): returns the IP port number on which the request was
received.
getRemotePort(): returns the IP port number of the client or last proxy that
sent this request.
getLocalName(): returns the host name on which this request was received.
getLocalAddr(): returns the IP address of the network interface on which
the request was received.
The ServletResponse and ServletResponseWrapper classes define two new
methods for internationalization support:
The setCharacterEncoding(String) method sets the character encoding
for the response back to the web client’s character encoding. In earlier Java
Servlets API specifications this was done using the charset parameter
specified to the setContentType(String) method (for example,
setContentType("text/html;charset=en-us"); ) or by using a Locale specified to
the setLocale(Locale) method. Note that this method has no effect if it is
called after a getWriter() method has been invoked or if the response has
already been committed.
For a list of the character sets allowed, see
http://www.iana.org/assignments/character-sets for more details.
The getContentType() method returns the content type used for the data
sent in the response.
The SingleThreadModel interface has been deprecated; there is no replacement.
To ensure that code is thread-safe, use multi-threaded programming paradigms
(avoiding sharing, setting, or using instance variables or then using synchronized
blocks of code for accessing common storage). Note that the SingleThreadModel
does not solve all thread-safe issues (access to session attributes, static variables,
and so on) even though multiple instances of the servlet are loaded in memory.
Null values passed to the ServletRequest.setAttribute(String,
Object) method are equivalent to calling
ServletRequest.removeAttribute(String) method.
The HttpServletRequest.getAuthType() method returns a container-
specific scheme in addition to the four pre-defined authentication schemes.
The Deployment Descriptor web.xml is extensible, and is defined in terms of an
XML schema document, and has some new elements.