Thanks Riyad. The problem with having the form hang around is. There could potentially be a very large number of
sessions (users) , all with a form to hang on to. So, the memory consumption could end up causing problems.


Riyad Kalla wrote:

You can forcibly remove it as the last step in your last action before sending the user to a success page:
request.getSession().setAttribute("formName", null);


where "formName" is the same name you gave the bean in your struts-config.xml file in the "form-beans" section of the file. There is no automatic way I know of that you can tell Struts to destroy an object on purpose.

If you just want to reset the form, and not null it out, make your last line instead of the setAttribute, make it:
form.reset();


this way the form is still cached for use, but values are empty.

ksitron wrote:


I have an action form whose data is needed across several JSP's, for this reason I set the scope to session for this ActionForm in my
struts-config.xml.
When the transaction is completed I want the form to go away. What is the best practice for this.


Thanks in advance.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--

Kevin J Citron
Sr. Object Imagineer
Optimized Objects, Inc.
EL Paso, Texas 79930
(915) 565-7785/566-2403



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to