On Sat, 12 Feb 2005 16:17:53 -0500, Sean Schofield
<[EMAIL PROTECTED]> wrote:
> I was wondering if a renderer needs to be thread safe?  Specifically I
> was hoping to use a class variable as a "counter" so I could keep
> track of various counts while I called a certain method recursively.
> 

Yes, they have to be thread safe ... there's only one instance in
memory (just like a servlet).

The best way for a renderer to keep track of stuff like counters would
be to use one of the generic attributes on the component it is
rendering.  If you use fully qualified attribute names
(com.mycompany.foo.COUNTER) you'll avoid collisions with other code
that is doing the same sort of thing.

Craig

Reply via email to