• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ending the session of a form?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hiya
thanks very much the session.removeAttribute("questionForm"); worked great!
thanks again
Sheetal
reply
    Bookmark Topic Watch Topic
  • New Topic