Multiple requests cause TagHandlers to be executed simultaneously several times
and therefore the rendered page is full of duplicated components. This happens
if the user performs a page refresh while a TagHandler apply() action is still
running. The consequence: The same TagHandler instance is used by another Tomcat
thread and apply() is invoked as many times as the user refreshes the page. All
the JSF components referenced in the TagHandlers are therefore added several
times to the component tree and the rendered page is totally deformed. This also
applies if the user clicks several times on a link to a Facelets-rendered page
if the response isn't yet generated.
We tried to solve this issue by holding a set of currently active tagIds for a
request: The current tagId is put into a session bean before apply() is invoked.
After the invocation, the tagId is removed. If the current tagId is already in
the Set, then the invocation of apply() is suppressed. Unfortunately this only
works with our own TagHandlers – Facelets-internal TagHandlers can't be adapted
because we cannot influence their apply() behaviour without using AOP.
Are there any other hints or ideas how to solve that? It would be great if
Facelets framework could handle that. Thread connection pooling cannot be turned
off in Tomcat for obvious reasons.
Thanks in advance!
Using Tomcat 6.0.16, JSF 1.2 Sun RI, Windows XP