> -----Original Message-----
> From: mfaine [mailto:[EMAIL PROTECTED] 
> Subject: creation of new beans
> When a managed bean is created that has as properties other 
> beans, do these bean properties get instantiated as well?  
> For example, I have a bean UserBean with a property Center 
> that is itself a bean.  There are getCenter and setCenter 
> methods. When a new UserBean is instantiated will Center also 
> be instantiated or will it remain null?

Yes, the child beans will get created if they are configured as managed
properties of the parent bean. Be careful about the lifetimes though; if
your parent bean has a scope of session, but your child bean a scope of
request, the setter for that managed property is only called when the
parent is instantiated.

Kalle

Reply via email to