Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 83489 invoked from network); 4 Feb 2004 13:56:16 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 13:56:16 -0000 Received: (qmail 70347 invoked by uid 500); 4 Feb 2004 13:55:34 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 70308 invoked by uid 500); 4 Feb 2004 13:55:34 -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 70282 invoked from network); 4 Feb 2004 13:55:33 -0000 Received: from unknown (HELO sbcor270) (195.77.63.2) by daedalus.apache.org with SMTP; 4 Feb 2004 13:55:33 -0000 Received: from smailext.mailext.com ([10.7.3.160] RDNS failed) by sbcor270 with Microsoft SMTPSVC(5.0.2195.6713); Wed, 4 Feb 2004 14:50:11 +0100 Received: from sbext230.mailext.com ([10.7.3.210]) by smailext.mailext.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 4 Feb 2004 14:54:12 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Subject: RE: Accessing ActionForm from Servlet (was: Pajes + Struts) Date: Wed, 4 Feb 2004 14:54:11 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Accessing ActionForm from Servlet (was: Pajes + Struts) Thread-Index: AcPqhi2zdUzT15TMSeCbflsEp6Y3QQAlcMRw From: "Villalba Arias, Fredy [BILBOMATICA]" To: "Struts Users Mailing List" X-OriginalArrivalTime: 04 Feb 2004 13:54:12.0053 (UTC) FILETIME=[5E56B050:01C3EB26] 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 Thanx Joe, Andrew... you seem to have grasped the essence of my worries. Andrew: on your comment about Pajes (jejeje), yes. It's a nice simple = framework I've been working with for about 2 years now. I confess I have not been interested to become a Guru at it or something like that, but that's mostly because the core objects (the DOM objects to dinamycally manipulate an HTML template) were simple and sufficient enough for achieving what I wanted. I recommend you to take a look at it. It's worth it. About XMLC, had never heard of it. I might give it a look (when I have time!). Anyway, let me comment on your posting, Joe (read below): >These are initial steps towards making it easier=20 >to get an ActionForm instance for prepopulation=20 >on the way to the view. Be warned, this method=20 >does not use any of the logic for looking up an=20 >existing form bean in request or session scope=20 >under any name, either the forms name or the=20 >'attribute' property of an ActionMapping, since=20 >as you can see, the method gets neither a request=20 >or an action mapping. Yes. I suppose you say this about the action mapping because it's possible that very same ActionForm is being used from more than one Action. Am I right? In any case, Struts takes care of handling for you the association = between Action and ActionForm, including management of important aspects = such as Scope. Regarding the scope issue, I don't think it would be a problem = since, by the time the control is delegated (ActionForward-ed) to the external = component: (1) The Action's job is finished (execute / perform) -- at least, for = that request. (2) The Action is already associated to the appropriate ActionForm and = will remain so until the response is sent back (or further, depending on the = scope, right?). (3) It is not possible to have more than one ActionForm associated to an Action (at the same time), i.e. it's a 1:1 relationship (again, am I = right?) That's why I thought: if I can recover that very same ActionForm object = once accessible from the just-executed Action (the "actionForm" attribute), = then voila! (I believe that very same object is the one accessed through = the JSP-tags, isn't it?). However, I don't see how can the first issue affect me... if what I just = stated is true, that is. Do you? >I have been thinking about adding a method: >RequestUtils.createActionForm(fbc, servlet,=20 >request, scopeString, attributeString) which=20 >would integrate that logic as well, but I was=20 >waiting to make sure that no one objected to what=20 >I did a few weeks ago. Actually, I would also=20 >prefer to use a different method name like=20 >'findOrCreateActionForm' but I don't love that=20 >name, so I'm also waiting to come up with a=20 >method name that I like. A nice method to have would be something like: getCurrentActionForm(HttpServletRequest r, Action a) or getCurrentActionForm(HttpServletRequest r, Class actionClass) However, I don't know if I'm saying something stupid here, since I have the doubts I just stated above. >Also, there has been a lot of effort to factor=20 >certain things out of RequestUtils, so maybe it's=20 >time to find a different home for these methods.=20 >FormUtils? Definitively YES! --=20 Joe Germuska =20 Joe@Germuska.com =20 http://blog.germuska.com =20 "Imagine if every Thursday your shoes=20 exploded if you tied them the usual way. This=20 happens to us all the time with computers, and=20 nobody thinks of complaining." -- Jef Raskin --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003 =20 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003 =20 --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org