Hi

Doing that also means that the user will need to re-login. A better approach it 
to get the session-backed bean from the session map (by name) and simply remove 
it.

Yet another way is to implement a reset method in you bean that clears out 
stuff.

Hermod

-----Original Message-----
From: Mr Arvind Pandey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 06, 2006 12:06 PM
To: MyFaces Discussion
Subject: Re: Beans in session scope lifecycle


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 <[EMAIL PROTECTED]>
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/


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Reply via email to