Hi all,
I have a problem with a javabean. I can't get a reference in a
servlet. This is what I do:
1- I open a
jsp page with the following:
<jsp:useBean id="cal_bean" class="Calendar_Bean" scope="session"/>
Name = <%=cal_bean.getName()%> 1st time name is blank
2- the user may open a login window - which post to a servlet
3- in the servlet, I have the following code:
HttpSession session = req.getSession( false );
Calendar_Bean cal_bn = (Calendar_Bean)session.getAttribute ("cal_bean") ;
cal_bn.setName( str_uname ); got username using getParameter
4- when the login window is closed, I will to refresh the main page to display the user name.
Problem:
The username is always null even if I enter a name in the login window. Seems like the servlet doesn't have a reference to the javabean created in the jsp window. What's wrong with this?
Thanks,
Francois.