Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clearing the content of portletsession

 
manepalli rajesh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to persist the values entered in a jsp page, i used so many session attributes to store values in processaction of my method.
now i am able to persist in the jsp page. but problem is when user registered successfully, those values have to be removed in the textboxes. for this i want to clear the session . but i could not found any method of portletsession to clear the session(like httpsession clear method). please suggest me how to clear the content when userregistered succesfully.

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get a list of all of the attributes in the session with a method such as getAttributeNames or something like that.

You can then loop through each attribute name and then call the removeAttribute method.

I can't remember the exact method names, but it's something like that. Get all the attributes, loop through them one at a time, and then call a remove on each attribute. Then you have nothing in your session.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic