problem creating managed bean instance
Hai all,
In my jsp page i want to set the username and browser session id in the managed bean DemoBean.java
for that i am using code like this in gettable.jsp page
<%
String user=request.getParameter("username");
String browsersession=(HttpSession) facesContext.getCurrentInstance().getExternalContext().getSession(false).getId();
FacesContext facescontext = FacesContext.getCurrentInstance();
DemoBean demobean=(DemoBean) facesContext..getApplication().getVariableResolver().resolveVariable(facescontext,"DemoBean");
demobean.setUserName(user);
demobean.setBrowserSessionID(browsersession);
%>
So when it is creating the DemoBean object it is creating a new instance, so all the previous values are lost.
Then i tried with this code
DemoBean demobean=(DemoBean) FacesContext.getCurrentInstance().getExternalContext().getSessionMap.get("DemoBean");
When this line is executing a new instance is created demobean is created withnull value.
I want to get the current instance of DemoBean not a new instance with all previous values. So how to go for it.

