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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

When to remove session attribute when a session last thru several servlets

843835Apr 13 2003 — edited Apr 13 2003
Hello there,

The whole scenario is described as following:

First a user logged in to a website, as usual he comes to the main page.
The main page has several links , each of which links to different servlet (application). That means during a user's session, he will interact with several servlets(applications). Now I am writing one of these applications, which will have several jsp pages, I want to share some parameters between those pages, then session is a good place
to store them. But these parameters are only to be used in my application, after the user goes back to the home page clicking to the other application, he won't need those information any more.

But now I can not come up a good idea when to remove those attributes from session. Cause if I put "session.removeAttribute()" in jsp page, you don't know if user will visit the same page again. Maybe I should put some logic in the "home" link, when he wants to go back to homepage, that means he wants to leave my application for a while, then I can delete the session attribute I put during my application.

Did anyone meet the same problem before ?

Thanks,

Rachel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2003
Added on Apr 13 2003
4 comments
303 views