struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <hrab...@gmail.com>
Subject Re: [FORMDEF] Combining FormDef and Struts form definitions
Date Wed, 02 Nov 2005 19:33:59 GMT
On 11/2/05, Michael Jouravlev <jmikus@gmail.com> wrote:
>
> Um, that is not exactly what I asked about. I want to define
> resettable properties in struts-config.xml file (or somewhere else, I
> don't care where), for example:
>
> <form-bean name="LogonForm"
> type="org.apache.struts.validator.DynaValidatorForm">
>   <form-property name="username" type="java.lang.String"/>
>   <form-property name="password" type="java.lang.String" initial=""
> reset="true"/>
> </form-bean>

Well, once Struts supports resettable fields then it'll be supported
by FormDef.  FormDef supports the same attributes that <form-property>
supports.  (Of course, there's no reset yet in struts-config, so there
ain't any yet in formdef.  I'll put it there once we get it into
struts.)

> And then to use defined LogonForm bean in FormDef to bind it to
> business class or DTO, kind of like in your example:
>
> <form-definition>
>   <formset>
>     <form name="LogonForm" beanType="com.my.dto.UserInfoBean"/>
>   </formset>
> </form-definition>
>
> Here "name" attribute refers to the form bean that already defined in
> struts-config.xml. Or you create another attribute, whatever.

Then you'll define it in FormDef:

<form name="myForm"
         beanType="com.my.dto.UserInfoBean">
    <field property="password" initial="" reset="true"/>
</form>

> If this is not feasible, would be great if you added support for
> resettable properties directly to FormDef. I was just thinking that
> combining and reusing is better than redefining.
>
> Michael.

Hubert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message