I would probably use a lazy getter with a @Persist attached to the field.

Something like:

@Persist
private Matafuego matafuego;

public Metafuego getMetafuego()
{
   if (null == metafuego)
   {
       metafuego = new Metafuego();
   }

   return metafuego;
}

The page instance is guaranteed to be accessed by only a single thread at a
time, so that should be safe for you.

-- 
Kevin


On 5/17/08 10:01 AM, "Manuel Corrales" <[EMAIL PROTECTED]> wrote:

> Hi, here is my problem. I have a bean on my java page, but i am not using
> the beaneditorform component to create a new one. Acording to Alexander
> book, the beaneditorform component can handle the initialization of the
> bean, so you dont have to create one. As i am not using this component,
> should i define the bean with a sentence like this:
> 
> private Matafuego matafuego = new Matafuego();
> 
> or should i create the new instance on the onActivate method?
> 
> I tryied the first approach, but the bean is always the same (i guess
> because of the page pooling mechanism). What is the right approach to this?
> 
> Thanks very much.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to