Menu

#1 Fix documentation for JSF

open
nobody
None
5
2006-03-29
2006-03-29
No

De configuration for JSF as mentioned in the
documentation is hazardous.

There are two filters required for the WFNM session
cleaner to work with JSF, the SessionBindingFilter and
the PageNotifierFilter. However, great care should be
taken to configure of these two. Using the
configuration mentioned the documentation can lead to
unpredictable results.

The SessionBindingFilter stores the changes to the
sessions contents in a threadlocal. This threadlocal is
not removed when exiting the filter and not explicitly
created when entering the filter, leaving the
opportunity for requests to pick up changes from a
previous request.

The PageNotifierFilter clears the threadlocal when
exiting the filter.

In the configuration, care should be taken that the
PageNotifierFilter is always called when the
SessionBindingFilter is called. This cannot be achieved
by binding the pageNotifierFilter to .jsp pages,
because some JSF requests may not result in the
execution of a .jsp, but in a redirect.

The only valid way to configure WFNM is as follows (the
order IS important)

<filter-mapping>
<filter-name>wfnmPageNotifierFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<filter-mapping>
<filter-name>wfnmSessionBindingFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

Discussion


Log in to post a comment.

MongoDB Logo MongoDB