Reset Managed Bean in Action Servlet?

I've searched through the forum and have came close in finding the answer however the recommended solution is not working...

How can I use this code:

FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("beanName");

to reset a managed bean in an Action Servlet?

How can I get the managed bean in the Action Servlet and reset it?

I'm not after getting the HttpSession and invalidating it. I would just like to reset the managed bean in the servlet.

Thanks!

[550 byte] By [iamleia] at [2007-11-27 9:04:14]
# 1
Are you trying to reset your BackingBean which is in session scope ?I think you should use FacesContext.getCurrentInstance().getExternalContext().getRequest().getSession().remove()
Akash_Gangaa at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yes its in the session scope. Can I use that in a servlet/action class?
iamleia at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Why cant u have a user defined method in backing bean , which sets all instaces of that class to their defaluts.i mean (BackBean) xxxx.getSessionMap().get("bean").resetAll();
veerjaa at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The session used by JSF is the same session used in traditional servlets accessed via the HttpSession class.
RaymondDeCampoa at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
@RaymondDeCampo, Does resetting the managed bean same with resetting the session?@veerja, how will the bean know when to set all instaces of that class to their defaluts?Message was edited by: iamlei
iamleia at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> @RaymondDeCampo, Does resetting the managed

> bean same with resetting the session?

If you remove the bean from the session, using traditional servlet APIs, it will appear to JSF as an uninitialized managed bean. When the application uses it next, JSF will instantiate it and set the properties as normal.

RaymondDeCampoa at 2007-7-12 21:37:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...