Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 53948 invoked from network); 2 Nov 2005 20:32:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Nov 2005 20:32:47 -0000 Received: (qmail 20802 invoked by uid 500); 2 Nov 2005 20:32:36 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 20783 invoked by uid 500); 2 Nov 2005 20:32:36 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 20771 invoked by uid 99); 2 Nov 2005 20:32:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2005 12:32:36 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of hrabago@gmail.com designates 66.249.82.207 as permitted sender) Received: from [66.249.82.207] (HELO xproxy.gmail.com) (66.249.82.207) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2005 12:32:31 -0800 Received: by xproxy.gmail.com with SMTP id i30so362700wxd for ; Wed, 02 Nov 2005 12:32:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BcYOWgZwWqPDDag5UryB1dFlNuolS49dW+5N2M1gHeFc74a4Woid54wr48zm7slJ4+G1hj0A3inszLi5XkOvd6BEGK+RjVoLcMgOLrXdkbS0DxUopjaEKHz+vOHRPisPouG0sBq6DzY45/6yKOU4h335lQxar/Srnxh+WyNNJxg= Received: by 10.64.251.4 with SMTP id y4mr2173992qbh; Wed, 02 Nov 2005 12:32:14 -0800 (PST) Received: by 10.64.150.13 with HTTP; Wed, 2 Nov 2005 12:32:14 -0800 (PST) Message-ID: <7b809eef0511021232t29c924e4y53d91068476eb578@mail.gmail.com> Date: Wed, 2 Nov 2005 14:32:14 -0600 From: Hubert Rabago To: Struts Users Mailing List Subject: Re: [FORMDEF] Combining FormDef and Struts form definitions In-Reply-To: <1db115340511021157v65cbd017m4868e1873a67c75c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1db115340511020939x5623e5aet573d2ce00eb924f8@mail.gmail.com> <7b809eef0511021049p24925783o7497da36ddb3cd74@mail.gmail.com> <1db115340511021122m7adbb71dp92f8ec404a1c1447@mail.gmail.com> <7b809eef0511021133u5dbd8d51w364b3bf02dfd5868@mail.gmail.com> <1db115340511021157v65cbd017m4868e1873a67c75c@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 11/2/05, Michael Jouravlev wrote: > > If it were possible to use form definitions made in struts-config.xml, > then you would not have to reimplement this property in FormDef, and I > would not have to wait for you to reimplement it ;-) I would just > apply your patch to my copy of DynaActionForm, and FormDef would pick > up transparently whatever properties are defined in struts-config.xml. > Is it possible at all? Or is it too much work? I've wondered about this feature, but there are some problems. (Not to mention, this is the first time someone asked for it). For instance, what if the form defined isn't a DynaBean? And how would I let the user specify formatting requirements (for dates, numbers, etc)? Still, it's feasible. It's just sort of a reversal of what I tried to do. I wanted to reduce config info. If you defined your form one field at a time in struts-config, then defined them again in formdef-config, then you end up with two places you have to keep in sync. Not to mention validation.xml (if you were using it for that form). With the form defined in FormDef, you're sure the fields on the bean are represented on the form, and they're always in sync. Form field types already default to java.lang.String. You can even put validation rules right there! > In a way, this is similar to explicitly supporting all HTML tag > attributes in Struts tags instead of supporting whatever a developer > put into a tag as attribute, and to let user agent care about that. Not really. The reason the support is there is to allow you to add fields to a form that would otherwise limit you. If UserInfoBean had "username" and "password", the following:
... would give you a dyna form with "username" and "password" string fields. That said, you can customize each field the way you would a property configured in struts-config. Okay, that part's like the tag attribute support you mentioned. However, FormDef allows you to add fields to your form and not be limited by UserInfoBean: ... would give you a dyna form named "LogonForm" with "username", "password", and "selectedButton" fields. And with that add'l field, you can specify type, size, initial as you would in struts-config. > Michael. > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org