You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Charbel Abdul-Massih <ca...@soundbite.com> on 2006/12/05 16:25:41 UTC

Beans in session scope lifecycle

Hello,

I have a wizard flow that utilizes a backing bean in session scope...if
a user should cancel out of the wizard at any point, is there a way to
reset the backing bean and its properties??? Or better yet, is there a
way to completely remove the bean from the session so that next time the
user enters the wizard, it's instantiated again???

 

Thx,
Charbel

 

 

 


Re: Beans in session scope lifecycle

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

sounds that you need t:saveState in this case.

It pushes the bean in a special kind of scope, which durates it longer
than request and shorter than session. Means it is an ideal choice for
all kind of page-scope stuff, such as a wizard.

Usage:

<t:saveState value="#{wizardBean}"/>

cheers,

Gerald

On 12/5/06, Charbel Abdul-Massih <ca...@soundbite.com> wrote:
>
>
>
>
> Hello,
>
> I have a wizard flow that utilizes a backing bean in session scope…if a user
> should cancel out of the wizard at any point, is there a way to reset the
> backing bean and its properties??? Or better yet, is there a way to
> completely remove the bean from the session so that next time the user
> enters the wizard, it's instantiated again???
>
>
>
> Thx,
>  Charbel
>
>
>
>
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

RE: Beans in session scope lifecycle

Posted by ma...@accenture.com.
Try this:

 

FacesContext.getCurrentInstance().getApplication().createValueBinding("#
{ManagedBeanName} ").setValue(FacesContext.getCurrentInstance(), null);

 

 

________________________________

From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
Sent: 5 dicembre 2006 16.26
To: users@myfaces.apache.org
Subject: Beans in session scope lifecycle

 

Hello,

I have a wizard flow that utilizes a backing bean in session scope...if
a user should cancel out of the wizard at any point, is there a way to
reset the backing bean and its properties??? Or better yet, is there a
way to completely remove the bean from the session so that next time the
user enters the wizard, it's instantiated again???

 

Thx,
Charbel

 

 

 



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: Beans in session scope lifecycle

Posted by Mr Arvind Pandey <ar...@yahoo.co.in>.
Hi,

    When user cancels out of wizard then you can
execute the following lines of code :

FacesContext facesContext =
FacesContext.getCurrentInstance();
		HttpSession session = (HttpSession)
facesContext.getExternalContext().getSession(false);
		if (session != null) {
			session.invalidate();
		}

This will remove the session objects and whenever user
reenters the system, session beans will be
reinstanciated.

regards..
Arvind


--- Charbel Abdul-Massih <ca...@soundbite.com>
wrote:

> Hello,
> 
> I have a wizard flow that utilizes a backing bean in
> session scope...if
> a user should cancel out of the wizard at any point,
> is there a way to
> reset the backing bean and its properties??? Or
> better yet, is there a
> way to completely remove the bean from the session
> so that next time the
> user enters the wizard, it's instantiated again???
> 
>  
> 
> Thx,
> Charbel
> 
>  
> 
>  
> 
>  
> 
> 



		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/