Threading is identified in the Portlet Spec when it talks about the action and render request lifecycles. I believe JSR-286 puts some additional clairifications on this. In general, people who rely on things that need to be initialized for the FULL lifecycle in both servlet and portlet environments, I suggest they use request attributes. They are a bit slower then ThreadLocal but they will work and in the Portal environment, they have some additional flexibility.

Things that are safe to put on threadlocal are self-contained items that can be recreated lazily from a factory. You just need to know that this MAY be more then once for a given request.

Scott

Mario Ivankovits wrote:
Hi!
The short answer to your question is no, the bridge won't help you
here.  Portlet 1.0 didn't define support for filters or wrapping
request/response objects.  Hence initialization done in filters in the
servlet environment should be rewritten/migrated to FacesContextFactory.
This document does not talk about when to release the configured
resources again, does it?
Is there something in the spec which talks about when to release a
ThreadLocal again?


Ciao,
Mario


Reply via email to