Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ending the session of a form?

 
Sheetal Sachdev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a action class called questionAction and a form called questionForm. In the struts-config.xml file i have set the scope of the form to be 'session' as i use the same form across multiple jsp pages, and need to pass data around them.
I have a side navigation bar, when a user clicks a link on this bar, i would like to end the session of my questionForm, i.e. set all its values to null.
I know i can end the http session using...
HttpSession session = request.getSession();
session.invalidate();
...but this ends all the sessions.
How can I end the session of the questionForm, or clear all its values?
Thanks
Sheetal
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
explicitly call the reset method of the form
you may even get away with session.removeAttribute("questionForm"); but I've never tried it myself.
[ April 07, 2004: Message edited by: Marc Peabody ]
 
Sheetal Sachdev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
<br/>
<p>I am aware of the reset method, but how do i call this from a different actionClass, that doesnt have access to questionForm that i want to reset?</p>
thanks
 
Sheetal Sachdev
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiya
thanks very much the session.removeAttribute("questionForm"); worked great!
thanks again
Sheetal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic