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 Guide—525644-002
7-8
Changes from Servlet 2.3 to Servlet 2.4
Filters are configured such that they are invoked on RequestDispatcher 
include() and forward() calls. Use the <dispatcher> sub-element under 
the <filter-mapping> element in the deployment descriptor web.xml. 
For example, the following code configures filter mapping whereby a filter named 
"my Forward Filter" is invoked when the request being processed under a 
RequestDispatcher matches the <url-pattern> for a forward() call. 
 <filter-mapping>
 <filter-name>my Forward Filter</filter-name>
 <url-pattern>/myApp/*</url-pattern>
 <dispatcher>FORWARD</dispatcher>
</filter-mapping>
Supported values in the <dispatcher> sub-element include one or more 
combinations of REQUEST, INCLUDE, FORWARD, and ERROR.
•
New HttpSessionListener events for session migration and for Object binding.
New HttpSession event methods have been added for session migration 
(activation and passivation of Sessions) and for Object binding (bind and unbind 
operations) using the HttpSessionActivationListener and 
HttpSessionBindingListener interfaces. In addition, a new 
HttpSessionBindingEvent has been defined.
•
The HttpSessionListener.sessionDestroyed() event is now notified 
before the session is invalidated (and not after the session is invalidated as in 
previous API specifications).
•
Support for event notifications about state changes in the ServletRequest objects.
The Java Servlet 2.4 API specification also adds new Listener interfaces and Event 
classes to allow notifications of request lifecycle events and events for changes to 
request attributes. The ServletRequestListener and 
ServletRequestAttributeListener are the two new Listener interfaces, and 
the ServletRequestEvent and ServletRequestAttributeEvent are their 
corresponding event classes. Request lifecycle events are defined when the 
request is about to enter the first servlet or filter and when the request exits the last 
servlet or filter in the application filter chain for any web application. 
Some exceptions thrown in the Listener interfaces have an adverse impact on 
subsequent requests to a particular web application. For example, unhandled 
exceptions thrown when a ServletContextListener gets a servlet context 
initialization notification or when a ServletRequestListener gets a request 
initialization/destruction event or when a SessionListener gets a session 
timeout event.
•
The HttpSession.logout() method (added in an intermediate version of the 
Java Servlet 2.4 API specification) has been removed and will be addressed in the 
next version.










