To add an application server web session listener to your WebClient application, ensure that this  XML fragment is present under the web-app element in your web.xml.

<listener>
<listener-class>com.adcaustin.webclient.servletproxy.WebSessionListener</listener-class>
</listener>

When the listener is installed, then application clean-up will occur immediately when the session times out (as determined by the application server’s timeout settings). The user closing their browser window will also trigger a session clean-up. This is particularly important for WebSphere implementations.