Return-Path: Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 5919 invoked from network); 4 Oct 2000 19:52:30 -0000 Received: from mercury.sun.com (192.9.25.1) by locus.apache.org with SMTP; 4 Oct 2000 19:52:30 -0000 Received: from taller.eng.sun.com ([129.144.174.34]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id MAA03796 for ; Wed, 4 Oct 2000 12:52:30 -0700 (PDT) Received: from eng.sun.com (florence [129.144.251.146]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with ESMTP id MAA05370 for ; Wed, 4 Oct 2000 12:52:25 -0700 (PDT) Message-ID: <39DB8ABB.5C10FEAE@eng.sun.com> Date: Wed, 04 Oct 2000 12:53:31 -0700 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: struts-user@jakarta.apache.org Subject: Re: ActionForm clearing References: <39DB875A.1853125A@kdsi.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Don Jones wrote: > When using a do I need to manually clear the ActionForm > or is there some built-in STRUTS functionality that will do this for > me? It is probably right in front of me and I am not seeing it. In > my app, after a I forward back to the jsp from which > this form can be selected again. When selected the inputs from the > previous entry are still in the form. Here's how I normally handle this scenario. In the Action class that handles this form submit: * Perform whatever task is requested * Remove the form bean session attribute * Forward to whatever JSP page is appropriate. When the tag of the form sees that there is no form bean there, it will create a new one (with whatever default values you have defined in the class itself) and store it in the session. From the user's perspective, that's a new blank form. In general, it is a good practice to delete form beans from the session when you are through with them -- otherwise they just sit there occupying memory until the session is invalidated or timed out. > > Cheers, > Don Jones Craig McClanahan ==================== See you at ApacheCon Europe ! Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ Applications to Tomcat