You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Travis Reeder <tr...@ecommstats.com> on 2005/05/06 21:56:34 UTC
Clearing out a user's session beans
How can you access the managed session beans map if you wanted to have
them nullified for a particular user?
--
Travis Reeder
Ecommstats Web Analytics
www.ecommstats.com
Re: Clearing out a user's session beans
Posted by Craig McClanahan <cr...@gmail.com>.
Map map = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().
This gives you a Map that corresponds to your session scope
attributes, so doing remove() calls on it will remove them from the
real underlying session.
Craig
On 5/9/05, Travis Reeder <tr...@ecommstats.com> wrote:
> I don't want to invalidate the whole session, just want to get at the
> session map for managed beans to remove some of them from the map so
> they can get recreated. Possible?
>
> Travis
>
> Slawek wrote:
>
> > i gues u are trying to just logout user...
> > try that:
> >
> > public String logout(){
> > javax.servlet.http.HttpServletRequest request =
> >
> > (javax.servlet.http.HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
> >
> >
> > javax.servlet.http.HttpSession session = request.getSession();
> > session.invalidate();
> > session = request.getSession(true);
> >
> > return "after_logout";
> > }
> >
> >
> > bu if u want to null only particular beans than u must find them in
> > "session"
> >
> > somme time ago Matthias Wessendorf show my the this way... thanks
> > again Matthias
> >
> >
> > Slawek
> >
> >> How can you access the managed session beans map if you wanted to
> >> have them nullified for a particular user?
> >>
> >
> >
> >
>
> --
> Travis Reeder
> Ecommstats Web Analytics
> www.ecommstats.com
>
>
Re: Clearing out a user's session beans
Posted by Travis Reeder <tr...@ecommstats.com>.
I don't want to invalidate the whole session, just want to get at the
session map for managed beans to remove some of them from the map so
they can get recreated. Possible?
Travis
Slawek wrote:
> i gues u are trying to just logout user...
> try that:
>
> public String logout(){
> javax.servlet.http.HttpServletRequest request =
>
> (javax.servlet.http.HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
>
>
> javax.servlet.http.HttpSession session = request.getSession();
> session.invalidate();
> session = request.getSession(true);
>
> return "after_logout";
> }
>
>
> bu if u want to null only particular beans than u must find them in
> "session"
>
> somme time ago Matthias Wessendorf show my the this way... thanks
> again Matthias
>
>
> Slawek
>
>> How can you access the managed session beans map if you wanted to
>> have them nullified for a particular user?
>>
>
>
>
--
Travis Reeder
Ecommstats Web Analytics
www.ecommstats.com
Re: Clearing out a user's session beans
Posted by Slawek <ss...@o2.pl>.
i gues u are trying to just logout user...
try that:
public String logout(){
javax.servlet.http.HttpServletRequest request =
(javax.servlet.http.HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
javax.servlet.http.HttpSession session = request.getSession();
session.invalidate();
session = request.getSession(true);
return "after_logout";
}
bu if u want to null only particular beans than u must find them in
"session"
somme time ago Matthias Wessendorf show my the this way... thanks again
Matthias
Slawek
> How can you access the managed session beans map if you wanted to have
> them nullified for a particular user?
>