You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bernard Gaughran <be...@yahoo.ie> on 2004/02/17 11:11:07 UTC
Problem Dynamically creating form properties
Can someone PLEASE help?
I need to create a User Interface (in JSP) which
presents the user with a number of input fields. The
number of input fields is not known until run-time
(based on user selections in a previous screens).
The 2 issues I see are:
1. generating the JSP dynamically with the correct
number of properties
2. accessing these form fields in the action class.
Normally, form property definitions need to be
defined at compile time (whether you use Action Forms
or DynaForms)
Ideally, I'd like to use the struts framework to avail
of Validator,etc,etc. Also, I would like to use Struts
Dyna Forms.
Can anyone advise a suitable approach & sample code?
Bernard Gaughran
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem Dynamically creating form properties
Posted by Mark Lowe <ma...@talk21.com>.
Sure.. that sounds great. It was just the question where your bean
generation supported form beans with sql date, i was querying.
On 17 Feb 2004, at 16:43, Guillermo Meyer wrote:
> Our DynamicBean holds java.util.Calendar, not java.util.Date nor
> java.sql.Date.
>
> We have a persistence framework that converts ResultSet in a collection
> of DynamicBeans, so our Business layer doesn't use java.sql.Date but
> Calendar.
>
> We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
> layer, where we have transformers from DtynamicBean to
> PersistenceObjects, which are mapped to tables by our persistence
> framework.
>
> This is a sequence of saving a data in a database:
> 1) Browser submits a post.
> 2) Struts populate this parameters to the DynamicBean
> 3) Action uses (DynamicForm)form).getModel() and passes it to a service
> (JMX service)
> 3) the service recives DynamicBean and returns DynamicBean. Uses input
> DynamicBean to validate rules.
> 4) the service passes the validated DynamicBean to the persistence
> layer, where DynamicBean is transformed to Persistence Object.
> 5) Persistence framework persists this object in the database.
>
> Regards.
> Guillermo.
>
> -----Original Message-----
> From: Mark Lowe [mailto:mark.lowe@talk21.com]
> Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
>
>
>
> Should java.sql.Date belong in an form bean?
>
>
>
> On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
>
>> Hi Guillermo,
>> I have one question: will 'your trick' work also if I have
> properties
>> of type, for example, Short, or Integer, or java.sql.Date?
>>
>> Thanx and regards
>> marco
>>
>> -----Original Message-----
>> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
>> Sent: 17 February 2004 12:43
>> To: 'Struts Users Mailing List'
>> Subject: RE: Problem Dynamically creating form properties
>>
>> I previuosly posted a mail to this list asking why DynaForms are
>> called Dynamic if you have to declare them statically in
>> Struts-Config. But there was no answer :(
>>
>> We created in our project a DynamicBean (previous DynaBean release and
>
>> when Struts 1.1 was no available) and extended ActionForm to be a
>> holder of DynamicBean (somethind like this:
>> ((DynamicForm)form).getModel() returns a DynamicBean with all
>> properties.)
>>
>> So, we add html:text fields to the JSP and these are populated to this
>
>> DynamicForm without the need of declaring this property anywhere. And
>> we have optionall Contract asserter to verify properties in a
>> DynamicBean when needed (usually when using DynamicBean as a DTO
>> between Actions and
>> Business delegates)
>>
>> Cheers.
>> Guillermo.
>>
>>
>> -----Original Message-----
>> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
>> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
>> To: struts-user@jakarta.apache.org
>> Subject: Problem Dynamically creating form properties
>>
>>
>> Can someone PLEASE help?
>>
>> I need to create a User Interface (in JSP) which
>> presents the user with a number of input fields. The
>> number of input fields is not known until run-time
>> (based on user selections in a previous screens).
>>
>> The 2 issues I see are:
>> 1. generating the JSP dynamically with the correct
>> number of properties
>> 2. accessing these form fields in the action class.
>>
>> Normally, form property definitions need to be
>> defined at compile time (whether you use Action Forms
>> or DynaForms)
>>
>> Ideally, I'd like to use the struts framework to avail
>> of Validator,etc,etc. Also, I would like to use Struts
>> Dyna Forms.
>>
>> Can anyone advise a suitable approach & sample code?
>>
>> Bernard Gaughran
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Finance: Get your refund fast by filing online.
>> http://taxes.yahoo.com/filing.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>> NOTA DE CONFIDENCIALIDAD
>> Este mensaje (y sus anexos) es confidencial, esta dirigido
>> exclusivamente a las personas direccionadas en el mail y puede
>> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
>> (ii) amparada por el secreto profesional. Cualquier opinion en el
>> contenido, es exclusiva de su autor y no representa necesariamente la
>> opinion de Interbanking S.A. El acceso no autorizado, uso,
>> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
>> asumira responsabilidad ni obligacion legal alguna por cualquier
>> informacion incorrecta o alterada contenida en este mensaje. Si usted
>> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
>> destruirlo inmediatamente junto con todas las copias del mismo,
>> notificando al remitente. No debera utilizar, revelar, distribuir,
>> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
>
>> el destinatario. Muchas gracias.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Marco Mistroni <mm...@waersystems.com>.
Hi,
In my case I still declare properties in
Struts-config, so the validator still validates (as I have seen
>From the errors received :-)
I was curious 'bout Guillermo approach coz I was trying
To explore ways so that a change in parameters from
Backend layers will lead to as small changes as possible in other parts
of the code..
Adding one new parameter to struts-config won't harm me much, I still
Copy properties dynamically with BeanUtils (and In theory, as long as
the
Added parameter is not a 'key' one, I don't need to check for certain
values), but if I could get away even without writing data in struts
config....
My final goal will be to generate almost whole code with XDoclet..and If
u
Think that you can generate easily DTOs,EJBs,JDO and Hibernate stuff for
the backend, and DynaActionForm and struts-config for the webend, well,
there's
Not much you have to write or hardcode in your code, so... u change a
little
In the backend, regenerate code using XDoclet.....and ur work is done
For today :-), let's go and get a beer.....
But... I am exploring struts since only 2 months...so I m not aware
If there would be any drawback in using DynaActionForms, or if there
Are any 'flaws' by not validating parameters at Action level..
Opinions are welcome :-)
Regards
marco
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem Dynamically creating form properties
Posted by Mark Lowe <ma...@talk21.com>.
Nice.. Sounds like the daddy..
On 17 Feb 2004, at 18:32, Guillermo Meyer wrote:
> We do use Validation framework. DynamicForm is a top level class but we
> use ValidatorDynamicForm that extends DynamicForm.
> We use strategies to validate in each form declaring them in the
> action-mapping:
> <action path="/admCuenta" type="mypackage.CuentaAction"
> name="adminCuentaForm" parameter="dispatch" scope="session"
> validate="true">
> <set-property property="formValidate"
> value="mypackage.CuentaResetValidate"/>
> <set-property property="formReset"
> value="mypackage.CuentaResetValidate"/>
> ................
> ................
> </action>
>
> So you can "plug" any validations you need.
>
> And ValidatorDynamicForm invokes Validator framework in the validate()
> method. Note that we are using old version of validator
> (com.wintecinc.struts.action.Validator)
>
> -----Original Message-----
> From: Mark Lowe [mailto:mark.lowe@talk21.com]
> Sent: Martes, 17 de Febrero de 2004 02:23 p.m.
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
>
>
> The cost of the getters and setters IMO usually don't outweigh the
> benefits of the validation framework, and having something in the
> middle of the form submission and the action.
>
> Before struts validator action forms provided a convenient place to
> stick validation methods (and still do). So how does that work in this
> case? Sound like may as well do away with action forms and just use the
> parameter map.
>
>
>
> On 17 Feb 2004, at 18:06, Marco Mistroni wrote:
>
>> That sounds great (I hate write lot of set/get methods.. :-) )!
>>
>> One further enquiry: so the actual DynaBean TO PersistenceObject
>> 'transformation' is done where the DynaBean is 'created' (persistence
>> layer I guess....)?
>> Since as far as I understood that is the only place that knows about
>> properties stored in the DynaBean..
>>
>> Regards
>> marco
>>
>> -----Original Message-----
>> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
>> Sent: 17 February 2004 15:44
>> To: 'Struts Users Mailing List'
>> Subject: RE: Problem Dynamically creating form properties
>>
>> Our DynamicBean holds java.util.Calendar, not java.util.Date nor
>> java.sql.Date.
>>
>> We have a persistence framework that converts ResultSet in a
>> collection of DynamicBeans, so our Business layer doesn't use
>> java.sql.Date but Calendar.
>>
>> We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
>
>> layer, where we have transformers from DtynamicBean to
>> PersistenceObjects, which are mapped to tables by our persistence
>> framework.
>>
>> This is a sequence of saving a data in a database:
>> 1) Browser submits a post.
>> 2) Struts populate this parameters to the DynamicBean
>> 3) Action uses (DynamicForm)form).getModel() and passes it to a
>> service (JMX service)
>> 3) the service recives DynamicBean and returns DynamicBean. Uses input
>
>> DynamicBean to validate rules.
>> 4) the service passes the validated DynamicBean to the persistence
>> layer, where DynamicBean is transformed to Persistence Object.
>> 5) Persistence framework persists this object in the database.
>>
>> Regards.
>> Guillermo.
>>
>> -----Original Message-----
>> From: Mark Lowe [mailto:mark.lowe@talk21.com]
>> Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
>> To: Struts Users Mailing List
>> Subject: Re: Problem Dynamically creating form properties
>>
>>
>>
>> Should java.sql.Date belong in an form bean?
>>
>>
>>
>> On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
>>
>>> Hi Guillermo,
>>> I have one question: will 'your trick' work also if I have
>> properties
>>> of type, for example, Short, or Integer, or java.sql.Date?
>>>
>>> Thanx and regards
>>> marco
>>>
>>> -----Original Message-----
>>> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
>>> Sent: 17 February 2004 12:43
>>> To: 'Struts Users Mailing List'
>>> Subject: RE: Problem Dynamically creating form properties
>>>
>>> I previuosly posted a mail to this list asking why DynaForms are
>>> called Dynamic if you have to declare them statically in
>>> Struts-Config. But there was no answer :(
>>>
>>> We created in our project a DynamicBean (previous DynaBean release
>>> and
>>
>>> when Struts 1.1 was no available) and extended ActionForm to be a
>>> holder of DynamicBean (somethind like this:
>>> ((DynamicForm)form).getModel() returns a DynamicBean with all
>>> properties.)
>>>
>>> So, we add html:text fields to the JSP and these are populated to
>>> this
>>
>>> DynamicForm without the need of declaring this property anywhere. And
>
>>> we have optionall Contract asserter to verify properties in a
>>> DynamicBean when needed (usually when using DynamicBean as a DTO
>>> between Actions and Business delegates)
>>>
>>> Cheers.
>>> Guillermo.
>>>
>>>
>>> -----Original Message-----
>>> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
>>> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
>>> To: struts-user@jakarta.apache.org
>>> Subject: Problem Dynamically creating form properties
>>>
>>>
>>> Can someone PLEASE help?
>>>
>>> I need to create a User Interface (in JSP) which
>>> presents the user with a number of input fields. The
>>> number of input fields is not known until run-time
>>> (based on user selections in a previous screens).
>>>
>>> The 2 issues I see are:
>>> 1. generating the JSP dynamically with the correct
>>> number of properties
>>> 2. accessing these form fields in the action class.
>>>
>>> Normally, form property definitions need to be
>>> defined at compile time (whether you use Action Forms
>>> or DynaForms)
>>>
>>> Ideally, I'd like to use the struts framework to avail
>>> of Validator,etc,etc. Also, I would like to use Struts
>>> Dyna Forms.
>>>
>>> Can anyone advise a suitable approach & sample code?
>>>
>>> Bernard Gaughran
>>>
>>>
>>> __________________________________
>>> Do you Yahoo!?
>>> Yahoo! Finance: Get your refund fast by filing online.
>>> http://taxes.yahoo.com/filing.html
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>> NOTA DE CONFIDENCIALIDAD
>>> Este mensaje (y sus anexos) es confidencial, esta dirigido
>>> exclusivamente a las personas direccionadas en el mail y puede
>>> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
>>> (ii) amparada por el secreto profesional. Cualquier opinion en el
>>> contenido, es exclusiva de su autor y no representa necesariamente la
>
>>> opinion de Interbanking S.A. El acceso no autorizado, uso,
>>> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
>>> asumira responsabilidad ni obligacion legal alguna por cualquier
>>> informacion incorrecta o alterada contenida en este mensaje. Si usted
>
>>> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
>
>>> destruirlo inmediatamente junto con todas las copias del mismo,
>>> notificando al remitente. No debera utilizar, revelar, distribuir,
>>> imprimir o copiar este mensaje ni ninguna de sus partes si usted no
>>> es
>>
>>> el destinatario. Muchas gracias.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>> NOTA DE CONFIDENCIALIDAD
>> Este mensaje (y sus anexos) es confidencial, esta dirigido
>> exclusivamente a las personas direccionadas en el mail y puede
>> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
>> (ii) amparada por el secreto profesional. Cualquier opinion en el
>> contenido, es exclusiva de su autor y no representa necesariamente la
>> opinion de Interbanking S.A. El acceso no autorizado, uso,
>> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
>> asumira responsabilidad ni obligacion legal alguna por cualquier
>> informacion incorrecta o alterada contenida en este mensaje. Si usted
>> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
>> destruirlo inmediatamente junto con todas las copias del mismo,
>> notificando al remitente. No debera utilizar, revelar, distribuir,
>> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
>
>> el destinatario. Muchas gracias.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
We do use Validation framework. DynamicForm is a top level class but we
use ValidatorDynamicForm that extends DynamicForm.
We use strategies to validate in each form declaring them in the
action-mapping:
<action path="/admCuenta" type="mypackage.CuentaAction"
name="adminCuentaForm" parameter="dispatch" scope="session"
validate="true">
<set-property property="formValidate"
value="mypackage.CuentaResetValidate"/>
<set-property property="formReset"
value="mypackage.CuentaResetValidate"/>
.................
.................
</action>
So you can "plug" any validations you need.
And ValidatorDynamicForm invokes Validator framework in the validate()
method. Note that we are using old version of validator
(com.wintecinc.struts.action.Validator)
-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: Martes, 17 de Febrero de 2004 02:23 p.m.
To: Struts Users Mailing List
Subject: Re: Problem Dynamically creating form properties
The cost of the getters and setters IMO usually don't outweigh the
benefits of the validation framework, and having something in the
middle of the form submission and the action.
Before struts validator action forms provided a convenient place to
stick validation methods (and still do). So how does that work in this
case? Sound like may as well do away with action forms and just use the
parameter map.
On 17 Feb 2004, at 18:06, Marco Mistroni wrote:
> That sounds great (I hate write lot of set/get methods.. :-) )!
>
> One further enquiry: so the actual DynaBean TO PersistenceObject
> 'transformation' is done where the DynaBean is 'created' (persistence
> layer I guess....)?
> Since as far as I understood that is the only place that knows about
> properties stored in the DynaBean..
>
> Regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 15:44
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> Our DynamicBean holds java.util.Calendar, not java.util.Date nor
> java.sql.Date.
>
> We have a persistence framework that converts ResultSet in a
> collection of DynamicBeans, so our Business layer doesn't use
> java.sql.Date but Calendar.
>
> We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
> layer, where we have transformers from DtynamicBean to
> PersistenceObjects, which are mapped to tables by our persistence
> framework.
>
> This is a sequence of saving a data in a database:
> 1) Browser submits a post.
> 2) Struts populate this parameters to the DynamicBean
> 3) Action uses (DynamicForm)form).getModel() and passes it to a
> service (JMX service)
> 3) the service recives DynamicBean and returns DynamicBean. Uses input
> DynamicBean to validate rules.
> 4) the service passes the validated DynamicBean to the persistence
> layer, where DynamicBean is transformed to Persistence Object.
> 5) Persistence framework persists this object in the database.
>
> Regards.
> Guillermo.
>
> -----Original Message-----
> From: Mark Lowe [mailto:mark.lowe@talk21.com]
> Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
>
>
>
> Should java.sql.Date belong in an form bean?
>
>
>
> On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
>
>> Hi Guillermo,
>> I have one question: will 'your trick' work also if I have
> properties
>> of type, for example, Short, or Integer, or java.sql.Date?
>>
>> Thanx and regards
>> marco
>>
>> -----Original Message-----
>> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
>> Sent: 17 February 2004 12:43
>> To: 'Struts Users Mailing List'
>> Subject: RE: Problem Dynamically creating form properties
>>
>> I previuosly posted a mail to this list asking why DynaForms are
>> called Dynamic if you have to declare them statically in
>> Struts-Config. But there was no answer :(
>>
>> We created in our project a DynamicBean (previous DynaBean release
>> and
>
>> when Struts 1.1 was no available) and extended ActionForm to be a
>> holder of DynamicBean (somethind like this:
>> ((DynamicForm)form).getModel() returns a DynamicBean with all
>> properties.)
>>
>> So, we add html:text fields to the JSP and these are populated to
>> this
>
>> DynamicForm without the need of declaring this property anywhere. And
>> we have optionall Contract asserter to verify properties in a
>> DynamicBean when needed (usually when using DynamicBean as a DTO
>> between Actions and Business delegates)
>>
>> Cheers.
>> Guillermo.
>>
>>
>> -----Original Message-----
>> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
>> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
>> To: struts-user@jakarta.apache.org
>> Subject: Problem Dynamically creating form properties
>>
>>
>> Can someone PLEASE help?
>>
>> I need to create a User Interface (in JSP) which
>> presents the user with a number of input fields. The
>> number of input fields is not known until run-time
>> (based on user selections in a previous screens).
>>
>> The 2 issues I see are:
>> 1. generating the JSP dynamically with the correct
>> number of properties
>> 2. accessing these form fields in the action class.
>>
>> Normally, form property definitions need to be
>> defined at compile time (whether you use Action Forms
>> or DynaForms)
>>
>> Ideally, I'd like to use the struts framework to avail
>> of Validator,etc,etc. Also, I would like to use Struts
>> Dyna Forms.
>>
>> Can anyone advise a suitable approach & sample code?
>>
>> Bernard Gaughran
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Finance: Get your refund fast by filing online.
>> http://taxes.yahoo.com/filing.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>> NOTA DE CONFIDENCIALIDAD
>> Este mensaje (y sus anexos) es confidencial, esta dirigido
>> exclusivamente a las personas direccionadas en el mail y puede
>> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
>> (ii) amparada por el secreto profesional. Cualquier opinion en el
>> contenido, es exclusiva de su autor y no representa necesariamente la
>> opinion de Interbanking S.A. El acceso no autorizado, uso,
>> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
>> asumira responsabilidad ni obligacion legal alguna por cualquier
>> informacion incorrecta o alterada contenida en este mensaje. Si usted
>> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
>> destruirlo inmediatamente junto con todas las copias del mismo,
>> notificando al remitente. No debera utilizar, revelar, distribuir,
>> imprimir o copiar este mensaje ni ninguna de sus partes si usted no
>> es
>
>> el destinatario. Muchas gracias.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem Dynamically creating form properties
Posted by Mark Lowe <ma...@talk21.com>.
The cost of the getters and setters IMO usually don't outweigh the
benefits of the validation framework, and having something in the
middle of the form submission and the action.
Before struts validator action forms provided a convenient place to
stick validation methods (and still do). So how does that work in this
case? Sound like may as well do away with action forms and just use the
parameter map.
On 17 Feb 2004, at 18:06, Marco Mistroni wrote:
> That sounds great (I hate write lot of set/get methods.. :-) )!
>
> One further enquiry: so the actual DynaBean TO PersistenceObject
> 'transformation' is done where the DynaBean is 'created' (persistence
> layer
> I guess....)?
> Since as far as I understood that is the only place that knows about
> properties stored in the DynaBean..
>
> Regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 15:44
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> Our DynamicBean holds java.util.Calendar, not java.util.Date nor
> java.sql.Date.
>
> We have a persistence framework that converts ResultSet in a collection
> of DynamicBeans, so our Business layer doesn't use java.sql.Date but
> Calendar.
>
> We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
> layer, where we have transformers from DtynamicBean to
> PersistenceObjects, which are mapped to tables by our persistence
> framework.
>
> This is a sequence of saving a data in a database:
> 1) Browser submits a post.
> 2) Struts populate this parameters to the DynamicBean
> 3) Action uses (DynamicForm)form).getModel() and passes it to a service
> (JMX service)
> 3) the service recives DynamicBean and returns DynamicBean. Uses input
> DynamicBean to validate rules.
> 4) the service passes the validated DynamicBean to the persistence
> layer, where DynamicBean is transformed to Persistence Object.
> 5) Persistence framework persists this object in the database.
>
> Regards.
> Guillermo.
>
> -----Original Message-----
> From: Mark Lowe [mailto:mark.lowe@talk21.com]
> Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
>
>
>
> Should java.sql.Date belong in an form bean?
>
>
>
> On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
>
>> Hi Guillermo,
>> I have one question: will 'your trick' work also if I have
> properties
>> of type, for example, Short, or Integer, or java.sql.Date?
>>
>> Thanx and regards
>> marco
>>
>> -----Original Message-----
>> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
>> Sent: 17 February 2004 12:43
>> To: 'Struts Users Mailing List'
>> Subject: RE: Problem Dynamically creating form properties
>>
>> I previuosly posted a mail to this list asking why DynaForms are
>> called Dynamic if you have to declare them statically in
>> Struts-Config. But there was no answer :(
>>
>> We created in our project a DynamicBean (previous DynaBean release and
>
>> when Struts 1.1 was no available) and extended ActionForm to be a
>> holder of DynamicBean (somethind like this:
>> ((DynamicForm)form).getModel() returns a DynamicBean with all
>> properties.)
>>
>> So, we add html:text fields to the JSP and these are populated to this
>
>> DynamicForm without the need of declaring this property anywhere. And
>> we have optionall Contract asserter to verify properties in a
>> DynamicBean when needed (usually when using DynamicBean as a DTO
>> between Actions and
>> Business delegates)
>>
>> Cheers.
>> Guillermo.
>>
>>
>> -----Original Message-----
>> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
>> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
>> To: struts-user@jakarta.apache.org
>> Subject: Problem Dynamically creating form properties
>>
>>
>> Can someone PLEASE help?
>>
>> I need to create a User Interface (in JSP) which
>> presents the user with a number of input fields. The
>> number of input fields is not known until run-time
>> (based on user selections in a previous screens).
>>
>> The 2 issues I see are:
>> 1. generating the JSP dynamically with the correct
>> number of properties
>> 2. accessing these form fields in the action class.
>>
>> Normally, form property definitions need to be
>> defined at compile time (whether you use Action Forms
>> or DynaForms)
>>
>> Ideally, I'd like to use the struts framework to avail
>> of Validator,etc,etc. Also, I would like to use Struts
>> Dyna Forms.
>>
>> Can anyone advise a suitable approach & sample code?
>>
>> Bernard Gaughran
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Finance: Get your refund fast by filing online.
>> http://taxes.yahoo.com/filing.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>> NOTA DE CONFIDENCIALIDAD
>> Este mensaje (y sus anexos) es confidencial, esta dirigido
>> exclusivamente a las personas direccionadas en el mail y puede
>> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
>> (ii) amparada por el secreto profesional. Cualquier opinion en el
>> contenido, es exclusiva de su autor y no representa necesariamente la
>> opinion de Interbanking S.A. El acceso no autorizado, uso,
>> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
>> asumira responsabilidad ni obligacion legal alguna por cualquier
>> informacion incorrecta o alterada contenida en este mensaje. Si usted
>> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
>> destruirlo inmediatamente junto con todas las copias del mismo,
>> notificando al remitente. No debera utilizar, revelar, distribuir,
>> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
>
>> el destinatario. Muchas gracias.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede contener
> informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
> amparada por el secreto profesional. Cualquier opinion en el contenido,
> es exclusiva de su autor y no representa necesariamente la opinion de
> Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
> divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
> ni obligacion legal alguna por cualquier informacion incorrecta o
> alterada contenida en este mensaje. Si usted ha recibido este mensaje
> por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
> junto con todas las copias del mismo, notificando al remitente. No
> debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
> ninguna de sus partes si usted no es el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
DynamicBean2PersistenceObject is a class that we use and implements
org.apache.commons.collections.Transformer.
The business layer uses these classes to transform inputBean
(DyanmicBean) to the corresponding PersietenceObject and passes this
PersistenceObject to the Persistence framework to be "persisted" (too
much persist words!)
We can use DynamicBean.copyTo(Object) method that uses reflection to
pass values from dynamicBean to PersistenceObject.
Cheers.
Guillermo.
-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com]
Sent: Martes, 17 de Febrero de 2004 02:06 p.m.
To: 'Struts Users Mailing List'; gmeyer@sib.interbanking.com.ar
Subject: RE: Problem Dynamically creating form properties
That sounds great (I hate write lot of set/get methods.. :-) )!
One further enquiry: so the actual DynaBean TO PersistenceObject
'transformation' is done where the DynaBean is 'created' (persistence
layer I guess....)? Since as far as I understood that is the only place
that knows about properties stored in the DynaBean..
Regards
marco
-----Original Message-----
From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
Sent: 17 February 2004 15:44
To: 'Struts Users Mailing List'
Subject: RE: Problem Dynamically creating form properties
Our DynamicBean holds java.util.Calendar, not java.util.Date nor
java.sql.Date.
We have a persistence framework that converts ResultSet in a collection
of DynamicBeans, so our Business layer doesn't use java.sql.Date but
Calendar.
We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
layer, where we have transformers from DtynamicBean to
PersistenceObjects, which are mapped to tables by our persistence
framework.
This is a sequence of saving a data in a database:
1) Browser submits a post.
2) Struts populate this parameters to the DynamicBean
3) Action uses (DynamicForm)form).getModel() and passes it to a service
(JMX service)
3) the service recives DynamicBean and returns DynamicBean. Uses input
DynamicBean to validate rules.
4) the service passes the validated DynamicBean to the persistence
layer, where DynamicBean is transformed to Persistence Object.
5) Persistence framework persists this object in the database.
Regards.
Guillermo.
-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
To: Struts Users Mailing List
Subject: Re: Problem Dynamically creating form properties
Should java.sql.Date belong in an form bean?
On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
> Hi Guillermo,
> I have one question: will 'your trick' work also if I have
properties
> of type, for example, Short, or Integer, or java.sql.Date?
>
> Thanx and regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 12:43
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> I previuosly posted a mail to this list asking why DynaForms are
> called Dynamic if you have to declare them statically in
> Struts-Config. But there was no answer :(
>
> We created in our project a DynamicBean (previous DynaBean release and
> when Struts 1.1 was no available) and extended ActionForm to be a
> holder of DynamicBean (somethind like this:
> ((DynamicForm)form).getModel() returns a DynamicBean with all
> properties.)
>
> So, we add html:text fields to the JSP and these are populated to this
> DynamicForm without the need of declaring this property anywhere. And
> we have optionall Contract asserter to verify properties in a
> DynamicBean when needed (usually when using DynamicBean as a DTO
> between Actions and
> Business delegates)
>
> Cheers.
> Guillermo.
>
>
> -----Original Message-----
> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
> To: struts-user@jakarta.apache.org
> Subject: Problem Dynamically creating form properties
>
>
> Can someone PLEASE help?
>
> I need to create a User Interface (in JSP) which
> presents the user with a number of input fields. The
> number of input fields is not known until run-time
> (based on user selections in a previous screens).
>
> The 2 issues I see are:
> 1. generating the JSP dynamically with the correct
> number of properties
> 2. accessing these form fields in the action class.
>
> Normally, form property definitions need to be
> defined at compile time (whether you use Action Forms
> or DynaForms)
>
> Ideally, I'd like to use the struts framework to avail
> of Validator,etc,etc. Also, I would like to use Struts
> Dyna Forms.
>
> Can anyone advise a suitable approach & sample code?
>
> Bernard Gaughran
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Marco Mistroni <mm...@waersystems.com>.
That sounds great (I hate write lot of set/get methods.. :-) )!
One further enquiry: so the actual DynaBean TO PersistenceObject
'transformation' is done where the DynaBean is 'created' (persistence
layer
I guess....)?
Since as far as I understood that is the only place that knows about
properties stored in the DynaBean..
Regards
marco
-----Original Message-----
From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
Sent: 17 February 2004 15:44
To: 'Struts Users Mailing List'
Subject: RE: Problem Dynamically creating form properties
Our DynamicBean holds java.util.Calendar, not java.util.Date nor
java.sql.Date.
We have a persistence framework that converts ResultSet in a collection
of DynamicBeans, so our Business layer doesn't use java.sql.Date but
Calendar.
We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
layer, where we have transformers from DtynamicBean to
PersistenceObjects, which are mapped to tables by our persistence
framework.
This is a sequence of saving a data in a database:
1) Browser submits a post.
2) Struts populate this parameters to the DynamicBean
3) Action uses (DynamicForm)form).getModel() and passes it to a service
(JMX service)
3) the service recives DynamicBean and returns DynamicBean. Uses input
DynamicBean to validate rules.
4) the service passes the validated DynamicBean to the persistence
layer, where DynamicBean is transformed to Persistence Object.
5) Persistence framework persists this object in the database.
Regards.
Guillermo.
-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
To: Struts Users Mailing List
Subject: Re: Problem Dynamically creating form properties
Should java.sql.Date belong in an form bean?
On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
> Hi Guillermo,
> I have one question: will 'your trick' work also if I have
properties
> of type, for example, Short, or Integer, or java.sql.Date?
>
> Thanx and regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 12:43
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> I previuosly posted a mail to this list asking why DynaForms are
> called Dynamic if you have to declare them statically in
> Struts-Config. But there was no answer :(
>
> We created in our project a DynamicBean (previous DynaBean release and
> when Struts 1.1 was no available) and extended ActionForm to be a
> holder of DynamicBean (somethind like this:
> ((DynamicForm)form).getModel() returns a DynamicBean with all
> properties.)
>
> So, we add html:text fields to the JSP and these are populated to this
> DynamicForm without the need of declaring this property anywhere. And
> we have optionall Contract asserter to verify properties in a
> DynamicBean when needed (usually when using DynamicBean as a DTO
> between Actions and
> Business delegates)
>
> Cheers.
> Guillermo.
>
>
> -----Original Message-----
> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
> To: struts-user@jakarta.apache.org
> Subject: Problem Dynamically creating form properties
>
>
> Can someone PLEASE help?
>
> I need to create a User Interface (in JSP) which
> presents the user with a number of input fields. The
> number of input fields is not known until run-time
> (based on user selections in a previous screens).
>
> The 2 issues I see are:
> 1. generating the JSP dynamically with the correct
> number of properties
> 2. accessing these form fields in the action class.
>
> Normally, form property definitions need to be
> defined at compile time (whether you use Action Forms
> or DynaForms)
>
> Ideally, I'd like to use the struts framework to avail
> of Validator,etc,etc. Also, I would like to use Struts
> Dyna Forms.
>
> Can anyone advise a suitable approach & sample code?
>
> Bernard Gaughran
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
Our DynamicBean holds java.util.Calendar, not java.util.Date nor
java.sql.Date.
We have a persistence framework that converts ResultSet in a collection
of DynamicBeans, so our Business layer doesn't use java.sql.Date but
Calendar.
We use DynamicBean as DTO from UI (used by DynamicForm) to persistence
layer, where we have transformers from DtynamicBean to
PersistenceObjects, which are mapped to tables by our persistence
framework.
This is a sequence of saving a data in a database:
1) Browser submits a post.
2) Struts populate this parameters to the DynamicBean
3) Action uses (DynamicForm)form).getModel() and passes it to a service
(JMX service)
3) the service recives DynamicBean and returns DynamicBean. Uses input
DynamicBean to validate rules.
4) the service passes the validated DynamicBean to the persistence
layer, where DynamicBean is transformed to Persistence Object.
5) Persistence framework persists this object in the database.
Regards.
Guillermo.
-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: Martes, 17 de Febrero de 2004 12:34 p.m.
To: Struts Users Mailing List
Subject: Re: Problem Dynamically creating form properties
Should java.sql.Date belong in an form bean?
On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
> Hi Guillermo,
> I have one question: will 'your trick' work also if I have
properties
> of type, for example, Short, or Integer, or java.sql.Date?
>
> Thanx and regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 12:43
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> I previuosly posted a mail to this list asking why DynaForms are
> called Dynamic if you have to declare them statically in
> Struts-Config. But there was no answer :(
>
> We created in our project a DynamicBean (previous DynaBean release and
> when Struts 1.1 was no available) and extended ActionForm to be a
> holder of DynamicBean (somethind like this:
> ((DynamicForm)form).getModel() returns a DynamicBean with all
> properties.)
>
> So, we add html:text fields to the JSP and these are populated to this
> DynamicForm without the need of declaring this property anywhere. And
> we have optionall Contract asserter to verify properties in a
> DynamicBean when needed (usually when using DynamicBean as a DTO
> between Actions and
> Business delegates)
>
> Cheers.
> Guillermo.
>
>
> -----Original Message-----
> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
> To: struts-user@jakarta.apache.org
> Subject: Problem Dynamically creating form properties
>
>
> Can someone PLEASE help?
>
> I need to create a User Interface (in JSP) which
> presents the user with a number of input fields. The
> number of input fields is not known until run-time
> (based on user selections in a previous screens).
>
> The 2 issues I see are:
> 1. generating the JSP dynamically with the correct
> number of properties
> 2. accessing these form fields in the action class.
>
> Normally, form property definitions need to be
> defined at compile time (whether you use Action Forms
> or DynaForms)
>
> Ideally, I'd like to use the struts framework to avail
> of Validator,etc,etc. Also, I would like to use Struts
> Dyna Forms.
>
> Can anyone advise a suitable approach & sample code?
>
> Bernard Gaughran
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o
> (ii) amparada por el secreto profesional. Cualquier opinion en el
> contenido, es exclusiva de su autor y no representa necesariamente la
> opinion de Interbanking S.A. El acceso no autorizado, uso,
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no
> asumira responsabilidad ni obligacion legal alguna por cualquier
> informacion incorrecta o alterada contenida en este mensaje. Si usted
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de
> destruirlo inmediatamente junto con todas las copias del mismo,
> notificando al remitente. No debera utilizar, revelar, distribuir,
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem Dynamically creating form properties
Posted by Mark Lowe <ma...@talk21.com>.
Should java.sql.Date belong in an form bean?
On 17 Feb 2004, at 16:15, Marco Mistroni wrote:
> Hi Guillermo,
> I have one question: will 'your trick' work also if I have
> properties of type, for example, Short, or Integer, or java.sql.Date?
>
> Thanx and regards
> marco
>
> -----Original Message-----
> From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
> Sent: 17 February 2004 12:43
> To: 'Struts Users Mailing List'
> Subject: RE: Problem Dynamically creating form properties
>
> I previuosly posted a mail to this list asking why DynaForms are called
> Dynamic if you have to declare them statically in Struts-Config. But
> there was no answer :(
>
> We created in our project a DynamicBean (previous DynaBean release and
> when Struts 1.1 was no available) and extended ActionForm to be a
> holder
> of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
> returns a DynamicBean with all properties.)
>
> So, we add html:text fields to the JSP and these are populated to this
> DynamicForm without the need of declaring this property anywhere. And
> we
> have optionall Contract asserter to verify properties in a DynamicBean
> when needed (usually when using DynamicBean as a DTO between Actions
> and
> Business delegates)
>
> Cheers.
> Guillermo.
>
>
> -----Original Message-----
> From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
> Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
> To: struts-user@jakarta.apache.org
> Subject: Problem Dynamically creating form properties
>
>
> Can someone PLEASE help?
>
> I need to create a User Interface (in JSP) which
> presents the user with a number of input fields. The
> number of input fields is not known until run-time
> (based on user selections in a previous screens).
>
> The 2 issues I see are:
> 1. generating the JSP dynamically with the correct
> number of properties
> 2. accessing these form fields in the action class.
>
> Normally, form property definitions need to be
> defined at compile time (whether you use Action Forms
> or DynaForms)
>
> Ideally, I'd like to use the struts framework to avail
> of Validator,etc,etc. Also, I would like to use Struts
> Dyna Forms.
>
> Can anyone advise a suitable approach & sample code?
>
> Bernard Gaughran
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido
> exclusivamente a las personas direccionadas en el mail y puede contener
> informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
> amparada por el secreto profesional. Cualquier opinion en el contenido,
> es exclusiva de su autor y no representa necesariamente la opinion de
> Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
> divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
> ni obligacion legal alguna por cualquier informacion incorrecta o
> alterada contenida en este mensaje. Si usted ha recibido este mensaje
> por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
> junto con todas las copias del mismo, notificando al remitente. No
> debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
> ninguna de sus partes si usted no es el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
DynamicBean can have it's properties typed:
Example:
DynamicBean db = DynamicBeanFactory.create();
db.setCalendar("date", Calendar.getInstance());
db.setLong("idXX", 123);
db.setString("prop", "Hello World");
db.setObject("objPropName", new Object());
db.add("collectionPropName", "Item1"); //this creates a collection.
When form gets populated, all properties are String, but conversions are
done when getting these values.
//populating posted values...
db.setObject("date", "5/2/2004");
db.setObject("idOperator", "19580001");
//getting it from Action
db.getCalendar("date"); //should return a calendar with that date.
db.getLong("idOperator"); //returns a long 19580001
Cheers.
Guillermo.
-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com]
Sent: Martes, 17 de Febrero de 2004 12:16 p.m.
To: 'Struts Users Mailing List'; gmeyer@sib.interbanking.com.ar
Subject: RE: Problem Dynamically creating form properties
Hi Guillermo,
I have one question: will 'your trick' work also if I have
properties of type, for example, Short, or Integer, or java.sql.Date?
Thanx and regards
marco
-----Original Message-----
From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
Sent: 17 February 2004 12:43
To: 'Struts Users Mailing List'
Subject: RE: Problem Dynamically creating form properties
I previuosly posted a mail to this list asking why DynaForms are called
Dynamic if you have to declare them statically in Struts-Config. But
there was no answer :(
We created in our project a DynamicBean (previous DynaBean release and
when Struts 1.1 was no available) and extended ActionForm to be a holder
of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
returns a DynamicBean with all properties.)
So, we add html:text fields to the JSP and these are populated to this
DynamicForm without the need of declaring this property anywhere. And we
have optionall Contract asserter to verify properties in a DynamicBean
when needed (usually when using DynamicBean as a DTO between Actions and
Business delegates)
Cheers.
Guillermo.
-----Original Message-----
From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
To: struts-user@jakarta.apache.org
Subject: Problem Dynamically creating form properties
Can someone PLEASE help?
I need to create a User Interface (in JSP) which
presents the user with a number of input fields. The
number of input fields is not known until run-time
(based on user selections in a previous screens).
The 2 issues I see are:
1. generating the JSP dynamically with the correct
number of properties
2. accessing these form fields in the action class.
Normally, form property definitions need to be
defined at compile time (whether you use Action Forms
or DynaForms)
Ideally, I'd like to use the struts framework to avail
of Validator,etc,etc. Also, I would like to use Struts
Dyna Forms.
Can anyone advise a suitable approach & sample code?
Bernard Gaughran
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Marco Mistroni <mm...@waersystems.com>.
Hi Guillermo,
I have one question: will 'your trick' work also if I have
properties of type, for example, Short, or Integer, or java.sql.Date?
Thanx and regards
marco
-----Original Message-----
From: Guillermo Meyer [mailto:gmeyer@interbanking.com.ar]
Sent: 17 February 2004 12:43
To: 'Struts Users Mailing List'
Subject: RE: Problem Dynamically creating form properties
I previuosly posted a mail to this list asking why DynaForms are called
Dynamic if you have to declare them statically in Struts-Config. But
there was no answer :(
We created in our project a DynamicBean (previous DynaBean release and
when Struts 1.1 was no available) and extended ActionForm to be a holder
of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
returns a DynamicBean with all properties.)
So, we add html:text fields to the JSP and these are populated to this
DynamicForm without the need of declaring this property anywhere. And we
have optionall Contract asserter to verify properties in a DynamicBean
when needed (usually when using DynamicBean as a DTO between Actions and
Business delegates)
Cheers.
Guillermo.
-----Original Message-----
From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
To: struts-user@jakarta.apache.org
Subject: Problem Dynamically creating form properties
Can someone PLEASE help?
I need to create a User Interface (in JSP) which
presents the user with a number of input fields. The
number of input fields is not known until run-time
(based on user selections in a previous screens).
The 2 issues I see are:
1. generating the JSP dynamically with the correct
number of properties
2. accessing these form fields in the action class.
Normally, form property definitions need to be
defined at compile time (whether you use Action Forms
or DynaForms)
Ideally, I'd like to use the struts framework to avail
of Validator,etc,etc. Also, I would like to use Struts
Dyna Forms.
Can anyone advise a suitable approach & sample code?
Bernard Gaughran
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem Dynamically creating form properties
Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
I previuosly posted a mail to this list asking why DynaForms are called
Dynamic if you have to declare them statically in Struts-Config. But
there was no answer :(
We created in our project a DynamicBean (previous DynaBean release and
when Struts 1.1 was no available) and extended ActionForm to be a holder
of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
returns a DynamicBean with all properties.)
So, we add html:text fields to the JSP and these are populated to this
DynamicForm without the need of declaring this property anywhere. And we
have optionall Contract asserter to verify properties in a DynamicBean
when needed (usually when using DynamicBean as a DTO between Actions and
Business delegates)
Cheers.
Guillermo.
-----Original Message-----
From: Bernard Gaughran [mailto:bernardgaughran@yahoo.ie]
Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
To: struts-user@jakarta.apache.org
Subject: Problem Dynamically creating form properties
Can someone PLEASE help?
I need to create a User Interface (in JSP) which
presents the user with a number of input fields. The
number of input fields is not known until run-time
(based on user selections in a previous screens).
The 2 issues I see are:
1. generating the JSP dynamically with the correct
number of properties
2. accessing these form fields in the action class.
Normally, form property definitions need to be
defined at compile time (whether you use Action Forms
or DynaForms)
Ideally, I'd like to use the struts framework to avail
of Validator,etc,etc. Also, I would like to use Struts
Dyna Forms.
Can anyone advise a suitable approach & sample code?
Bernard Gaughran
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org