Re: Struts 2: map-backed bean

2008-03-05 Thread Laurie Harper
Yes, ParameterAware is the interface if you want HTTP request parameters. L. Cheng Wei Lee wrote: Should I be implementing ParameterAware interface instead since the RequestAware gives me attributes instead of parameters from the form? On Wed, Mar 5, 2008 at 1:15 AM, Ian Roughley [EMAIL

Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
In Struts 1, we could use map-backed form beans to deal with dynamic forms, is there something equal in Struts 2?

Re: Struts 2: map-backed bean

2008-03-04 Thread Ian Roughley
If you implement the RequestAware interface, the map will contain all the form values. /Ian -- Ian Roughley From Down Around, Inc. Consulting * Agile Process * Open Source Advanced Struts2 Workshop, April 28-30, Sunnyvale CA web: http://www.fdar.com - email: [EMAIL PROTECTED] Cheng Wei

Re: Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
Suppose I use JavaScript to allow user to dynamically adds the number of textboxes in the form, then submit. Would implementing RequestAware help? Do I have to create the variables and getters/setters in advance at the action class? On Wed, Mar 5, 2008 at 1:15 AM, Ian Roughley [EMAIL PROTECTED]

Re: Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
Ok, silly me, the setRequest method would set all request parameters into the map, which I could then extract and use the values. Thanks for pointing out this. Should have read the APIs more carefully. On Wed, Mar 5, 2008 at 1:22 AM, Cheng Wei Lee [EMAIL PROTECTED] wrote: Suppose I use

Re: Struts 2: map-backed bean

2008-03-04 Thread Dave Newton
--- Cheng Wei Lee [EMAIL PROTECTED] wrote: Suppose I use JavaScript to allow user to dynamically adds the number of textboxes in the form, then submit. Would implementing RequestAware help? Do I have to create the variables and getters/setters in advance at the action class? You may also use

Re: Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
What I was thinking of doing, is to prefix the components at the JSP such that I can pick them up at action classes by iterating. Suppose I've 5 textfields that makes up a Person object, and the user dynamically adds 5 Persons at the JSP and submits, what I would do at my action class is to loop

Re: Struts 2: map-backed bean

2008-03-04 Thread Dave Newton
--- Cheng Wei Lee [EMAIL PROTECTED] wrote: What I was thinking of doing, is to prefix the components at the JSP such that I can pick them up at action classes by iterating. Suppose I've 5 textfields that makes up a Person object, and the user dynamically adds 5 Persons at the JSP and submits,

Re: Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
Thanks! On Wed, Mar 5, 2008 at 2:08 AM, Dave Newton [EMAIL PROTECTED] wrote: --- Cheng Wei Lee [EMAIL PROTECTED] wrote: What I was thinking of doing, is to prefix the components at the JSP such that I can pick them up at action classes by iterating. Suppose I've 5 textfields that makes

Re: Struts 2: map-backed bean

2008-03-04 Thread Cheng Wei Lee
Should I be implementing ParameterAware interface instead since the RequestAware gives me attributes instead of parameters from the form? On Wed, Mar 5, 2008 at 1:15 AM, Ian Roughley [EMAIL PROTECTED] wrote: If you implement the RequestAware interface, the map will contain all the form values.