[1]I have a class called 'Customer' which implements javax.servlet.http.HttpSessionBindingListener.
[2]I have a simple
jsp where an end user has to enter his name and then he has to submit to a
servlet.
[3]Inside this servlet I have a code as follows
doGet( blah blah.....)
{
String userName = request.getParameter("UserName");
Customer cust = new Customer(username);
//statement --->1
session.setAttribute("CustomerDetails", cust); /* When the container finds this statement, its going to invoke following code
valueBound(HttpSessionBindingEvent event)
{
/* Code that connects to database and gets the data that is associated to 'userName' and its corresponding 'address' and pass those two arguments to 'Customer' constructor. Now we got fresh 'Customer' type object and we are going to associate this newly created object to existing reference namely 'cust' */
}
Now my question, as you no that object 'cust' has ALREADY BEEN SET as attribute, in statement --->1, then are we sure that we set attribute with latest data from database?
[ September 17, 2007: Message edited by: Bear Bibeault ]