FacesContext
.getCurrentInstance()
.getApplication()
.createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );
To get session bean reference
Object obj = FacesContext
.getCurrentInstance()
.getApplication()
.createValueBinding("#{yourBeanName}")
.getValue(FacesContext.getCurrentInstance());
YourSessionBean bean = (YourSessionBean)obj;
We can also get managed bean from session map
ReplyDeleteObject obj = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("name of your managed bean")