Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 8732 invoked from network); 1 Jan 2008 14:46:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jan 2008 14:46:15 -0000 Received: (qmail 52432 invoked by uid 500); 1 Jan 2008 14:45:58 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 52378 invoked by uid 500); 1 Jan 2008 14:45:58 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 52367 invoked by uid 99); 1 Jan 2008 14:45:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 06:45:58 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [72.9.159.32] (HELO newton.inversoft.com) (72.9.159.32) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jan 2008 14:45:46 +0000 Received: from [192.168.1.3] (c-24-8-34-156.hsd1.co.comcast.net [24.8.34.156]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by newton.inversoft.com (Postfix) with ESMTP id 0716835D4088 for ; Tue, 1 Jan 2008 14:45:33 +0000 (UTC) Message-ID: <477A5217.5090102@pontarelli.com> Date: Tue, 01 Jan 2008 07:45:43 -0700 From: Brian Pontarelli User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Struts Developers List Subject: Re: invent way to get dropdown data in JSP not using actions or taglibs? References: <47791BD2.6050108@cyberspaceroad.com> <64063.170.201.180.136.1199119912.squirrel@webmail.chiron.lunarpages.com> In-Reply-To: <64063.170.201.180.136.1199119912.squirrel@webmail.chiron.lunarpages.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org It seems like this is a variation on the Preparable theme. I went through this decision process 9 months ago and decided to use the tag to prepare my forms, mostly for lack of any other solution. A few more things I ran into that I wanted and could only achieve with the - Share preparation between actions/forms without sub-classing. This occurs when you have two actions that share a form (add and edit for example) and both prepare the form in very similar ways, with some differences. The common preparation code should be written once and then accessible by both actions. - The preparation logic should ONLY be called when the form is rendered. If I'm remembering correctly, any action that implements Preparable is called via the interceptor chain during all submissions, including a valid form submission where the form doesn't need to be prepared again. The solution should be capable of understanding that the form is being rendered. Here's some more ideas for solutions: 1. Modify the tag so that if the action it is going to call implements Preparable than it is invoked prior to rendering the rest of the form. This would require removing the prepare interceptor altogether or removing it from the default stack. 2. Add a tag that somehow calls the preparation code. 3. Make the prepare interceptor more intelligent to understand when forms are being rendered (is this possible without major headaches?) -bp Frank W. Zammetti wrote: > Hi Adam, > > If I'm understanding you, what I think you essentially want is the JSF > concept of "page/component state saving" where, talking about an S2 app, > the page, and by extension the "components" on each page (dropdowns, > testboxes, etc), would know how to get their current state and render > themselves. > > I suppose you could do that today easy enough by storing the values (and > data, in the case of dropdowns) in session and always render from there. > Maybe not the best answer from a performance/resource utilization POV. > > Maybe better would be for each tag in each theme to accept an attribute > that specified the method of an action to call when rendering itself to > populate it's data (default to populateXXX() where XXX is the ID of the > element, so maybe the attribute is optional). Then you could do whatever > you wanted in that method to provide the tag the data it needs to render > the element with the current state. If that method isn't found, just let > the tag do whatever it would normally do now, so as to not break > backwards-compatibility, and let the developer only write the code they > really need to. > > (for all I know, S2 already offers this, I don't really know) > > Frank > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org