users@javaserverfaces.java.net

RE: Re: Which phase in the Lifecycle is a managed bean's constructor accessed?

From: Todd Patrick <Todd.Patrick_at_dtn.com>
Date: Thu, 31 May 2007 07:28:06 -0500

Ryan:

OK, that makes sense now. I put in a PhaseListener to output logging
details and I am finding the same results.

Thank you for the explanation.

--Todd

-----Original Message-----
From: Ryan.Lubke_at_Sun.COM [mailto:Ryan.Lubke_at_Sun.COM]
Sent: Wednesday, May 30, 2007 2:53 PM
To: users_at_javaserverfaces.dev.java.net
Subject: Re: Which phase in the Lifecycle is a managed bean's
constructor accessed?

Todd Patrick wrote:
> Which Phase in the Lifecycle is a managed bean's constructor accessed?
>
> In the Standard lifecycle, I believe it is 1, RESTORE_VIEW.
>
> There is no mention of the managed bean's constructor at:
>
> http://java.sun.com/javaee/5/docs/tutorial/doc/JSFIntro8.html#wp123500
>
> Thanks,
>
> --Todd
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information.
> Any unauthorized use, disclosure or distribution is prohibited. If you

> are not the intended recipient, please contact the sender by reply
> email and destroy all copies of the original message.
It depends on when the bean is first accessed with relation to its
scope.

Say you have a request scoped bean bound to the rendered attribute of
a component. The first time the view is accessed, the bean would be
created during RENDER_RESPONSE. On a post back, the same
bean would be created during APPLY_REQUEST_VALUES.

If the bean was session scoped, the constructor would most likely
only have been invoked the first time the view was rendered for that
user.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net