| Author |
ending the session of a form?
|
Sheetal Sachdev
Greenhorn
Joined: Mar 26, 2004
Posts: 6
|
|
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
Joined: Feb 05, 2003
Posts: 4725
|
|
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 ]
|
A good workman is known by his tools.
|
 |
Sheetal Sachdev
Greenhorn
Joined: Mar 26, 2004
Posts: 6
|
|
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
Joined: Mar 26, 2004
Posts: 6
|
|
hiya thanks very much the session.removeAttribute("questionForm"); worked great! thanks again Sheetal
|
 |
 |
|
|
subject: ending the session of a form?
|
|
|