Thread:
 web.xml filters don't work 
 mschipperheyn   10 Sep 2005, 19:53 
 Spring's OpenSessionInViewFilter 
 rlubbat   13 Sep 2005, 03:46 
 Re: web.xml filters don't work 
 mgj2   13 Sep 2005, 11:44 
 Re: web.xml filters don't work 
 pksiv   14 Oct 2005, 13:27 
 ThreadLocal Sessions and jsp:include 
 rbellia   25 Oct 2005, 11:41 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: rbellia (25 Oct 2005, 11:41) Replies: 0, Views: 33336
Subject: ThreadLocal Sessions and jsp:include
The new request triggered by <jsp:include ...> can easily avoid the
Thread Local Session management Filter.

The answer is in Servlet 2.4 spec at SRV.6.2.5:
"... By using the new <dispatcher> element in the deployment descriptor,
the developer can indicate for a filter-mapping whether he would like
the filter to be applied to requests when:
1. The request comes directly from the client. ...
2.  ... 
3. The request is being processed under a request dispatcher ... using
an include() call. ...
4. ...

Mapping the Filter like this in web.xml:
  ...
  <filter-mapping>
    <filter-name>TLSessionManagementFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  ...

It won´t intercept the <jsp:include> internal requests - Avoiding the
premature session closing.
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]