Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSP losing session attribute

843835Nov 20 2001 — edited Nov 20 2001
I'm creating a web application in which users can register with the site, login, and change their details.
To change their details, they must be logged in.
When a user logs in, an attribute is added to the session:
String username=request.getParameter("username");
session.setAttribute("username",username);
When the user clicks the Change Details link, the request is passed through a controller to a ChangeDetailsHandler servlet. At this point, the session attribute still exists. A UserInfoBean is also added to the session containing the user's details.
The request is then dispatched to changeDetails.jsp. Again, the username attribute is still in the session, as is the UserInfoBean.
When the user submits the changes to their details, the request goes through the controller to the ChangeDetailsHandler again. However, when it gets here, the session still contains the UserInfoBean, but has lost the username attribute.
I don't call session.removeAttribute() at any time. Any how this attribute could be lost?

Thanks,

Jim
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2001
Added on Nov 20 2001
3 comments
336 views