java - HttpSession, session.getAttribute(), problem -


i have problem related java servlet sessions. don't understand why getattribute() function of session object used before setattribute(); here code:

vector buylist=(vector)session.getattribute("register"); if (action.equals("del")) { string del = request.getparameter("deli"); int d = (new integer(del)).intvalue(); buylist.removeelementat(d); } session.setattribute("register", buylist); 

thanks.

because register attribute may set other place (like. jsp(in bad case),servlet or filter . . )


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -