Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 52410 invoked from network); 6 Nov 2003 15:58:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Nov 2003 15:58:18 -0000 Received: (qmail 22356 invoked by uid 500); 6 Nov 2003 15:56:26 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 22262 invoked by uid 500); 6 Nov 2003 15:56:24 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 22233 invoked from network); 6 Nov 2003 15:56:24 -0000 Received: from unknown (HELO hotmail.com) (64.4.23.95) by daedalus.apache.org with SMTP; 6 Nov 2003 15:56:24 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 6 Nov 2003 07:56:27 -0800 Received: from 141.123.100.69 by lw15fd.law15.hotmail.msn.com with HTTP; Thu, 06 Nov 2003 15:56:26 GMT X-Originating-IP: [141.123.100.69] X-Originating-Email: [stuts_andersonbd1@hotmail.com] From: "Ben Anderson" To: struts-user@jakarta.apache.org Bcc: Subject: Re: Best Practices in Struts for Form objects? Date: Thu, 06 Nov 2003 15:56:26 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 06 Nov 2003 15:56:27.0127 (UTC) FILETIME=[8934A870:01C3A47E] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N you probably only want one form set to request scope. If you use different forms, then that form is only valid for the one specific action it is associated with. For instance, if the submitting page contains a form that has a textbox where you can input your name. And you want to display the name on the next page using struts internal form processing, then the forms must be the same. As far as scope, I think you almost always want to use request scope. Session scope does wacky things. Don't think of the data as only being request scope - because as long as your workflow has that form in each page with the associated parameters(if you're not displaying them but need them preserved between requests - use html:hidden) then the data is almost like being session scoped. HTH, Ben >From: "Michael Cardon" >Reply-To: "Struts Users Mailing List" >To: >Subject: Best Practices in Struts for Form objects? >Date: Thu, 6 Nov 2003 07:35:04 -0800 > >Hello, > >If I have 5 Action classes that all need to reference the same Form object, >should I map each Action to the same form name, or use different names for >each of the Forms in the Actions? Does it make a difference if I�m using >session scope vs. request scope? > >Example using the same form names, same form class: > > > > type="mim.struts.action.pw.StudentPwAction" > name="pwForm" > scope="request" > validate="false" > parameter="dispatch"> > > > > type="mim.struts.action.pw.StudentPwAction" > name="pwForm" > scope="request" > validate="false" > parameter="dispatch"> > > > >... 3 more actions .... > > >Example using diferent form names, same form class: > > > > > type="mim.struts.action.pw.StudentPwAction" > name="teacherpwForm" > scope="request" > validate="false" > parameter="dispatch"> > > > > type="mim.struts.action.pw.StudentPwAction" > name="studentpwForm" > scope="request" > validate="false" > parameter="dispatch"> > > > >... 3 more actions .... > >Thanks > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: struts-user-help@jakarta.apache.org > _________________________________________________________________ Frustrated with dial-up? Get high-speed for as low as $26.95. https://broadband.msn.com (Prices may vary by service area.) --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org