It could, but it doesnt. Why not fix the Util class so that it does then
submit it back to the commiters?

> -----Original Message-----
> From: Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]]
> Sent: 09 April 2001 16:13
> To:   [EMAIL PROTECTED]
> Cc:   '[EMAIL PROTECTED]'
> Subject:      RE: POSTing arrays in struts
> 
> 
> 
> 
> I don't really understand why I have to do this. That's a lot of code to
> write too. The JSP code that I have below actually works on the read.
> Struts handles it fine and I see the actual data sitting in the input
> control when the form comes up in my browser. If struts can do that, I
> can't see why struts can't go the other way and match it up on a post so
> my
> "form' already has the data way before the 'perform' method is called.
> 
> 
> 
> 
>  
> 
>  
> 
>                                          To:
> "'[EMAIL PROTECTED]'"                                
>                     "Taylor,             <[EMAIL PROTECTED]>
> 
>                     Jeremy"              cc:     (bcc: Will Spies/Towers
> Perrin)                                   
>                     <jtaylor@lehm        Subject:     RE: POSTing arrays
> in struts                                 
>                     an.COM>
> 
>  
> 
>                     04/09/01
> 
>                     11:04 AM
> 
>                     Please
> 
>                     respond to
> 
>                     struts-user
> 
>  
> 
>  
> 
> 
> 
> 
> If all your input fields have the same name then when the form is
> submitted
> there will be a
> 
> in your Action class there will be a method "perform" has takes a
> parameter
> HttpServletRequest request,
> 
> so, rather than doing             PropertyUtils.copyProperties(user,
> form);
> 
> do something like
> 
> String[] rows = request.getParameterValues("InputFieldName");
> form.setRows(rows);
> 
> 
> > -----Original Message-----
> > From:         Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]]
> > Sent:         09 April 2001 15:41
> > To:           [EMAIL PROTECTED]
> > Cc:           '[EMAIL PROTECTED]'
> > Subject:           RE: POSTing arrays in struts
> >
> >
> >
> > Ok. Now we are talking.
> >
> > Q1: My save action class DOES work like the example. It gets the form
> and
> > expects the ActionServlet to fill it up. By the time I get the form, the
> > ActionServlet is done with it? How would I change this to work properly
> or
> > do I need a new version of the util class?
> >
> > Q2: I was under the impression the html:text tags did not work properly
> > inside an iterate tag.
> >
> >
> >
> >
> >
> >
> >
> >                                          To:
> > "'[EMAIL PROTECTED]'"
> >                     "Taylor,
> <[EMAIL PROTECTED]>
> >
> >                     Jeremy"              cc:     (bcc: Will Spies/Towers
> > Perrin)
> >                     <jtaylor@lehm        Subject:     RE: POSTing arrays
> > in struts
> >                     an.COM>
> >
> >
> >
> >                     04/09/01
> >
> >                     10:32 AM
> >
> >                     Please
> >
> >                     respond to
> >
> >                     struts-user
> >
> >
> >
> >
> >
> >
> >
> >
> > You don't need to generate index properties for the input tags.
> > Also, how does your save action class work? If you based it on the
> struts
> > examples you'll need to
> > change it because the util class that copies bean properties won't work
> > with
> > the array of values for the rows property.
> >
> > > -----Original Message-----
> > > From:         Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]]
> > > Sent:         09 April 2001 15:13
> > > To:           [EMAIL PROTECTED]
> > > Cc:           '[EMAIL PROTECTED]'
> > > Subject:           RE: POSTing arrays in struts
> > >
> > >
> > >
> > > 1. The iterate tag does not generate index properties for the
> html_text
> > > *input* tag
> > > 2. The html:text IS in input tag!
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >                                          To:
> > > "'[EMAIL PROTECTED]'"
> > >                     "Taylor,
> > <[EMAIL PROTECTED]>
> > >
> > >                     Jeremy"              cc:     (bcc: Will
> Spies/Towers
> > > Perrin)
> > >                     <jtaylor@lehm        Subject:     RE: POSTing
> arrays
> > > in struts
> > >                     an.COM>
> > >
> > >
> > >
> > >                     04/09/01
> > >
> > >                     10:08 AM
> > >
> > >                     Please
> > >
> > >                     respond to
> > >
> > >                     struts-user
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 1. use the iterate tag to iterate through the rows property
> > > 2. nothing happens on post because you have no input tags
> > >
> > > > -----Original Message-----
> > > > From:         Will Spies/Towers Perrin [SMTP:[EMAIL PROTECTED]]
> > > > Sent:         09 April 2001 14:35
> > > > To:           [EMAIL PROTECTED]
> > > > Subject:           POSTing arrays in struts
> > > >
> > > >
> > > >
> > > > I've read a couple archived notes on this topic and it's not helping
> > me
> > > so
> > > > here goes.
> > > >
> > > > I'm trying to post an array of data from my view (JSP) into my bean.
> > I'm
> > > > having great difficulty. Here is a JSP snipet of what I'm doing:
> > > >
> > > > <html:form action="/saveEmployees">
> > > > <table>
> > > >   <tr>
> > > >     <td align="left">
> > > >       <html:text property="data.rows[1].EmployeeName" size="30"
> > > maxlength
> > > > ="30"/>
> > > >     </td>
> > > >   </tr>
> > > >   <td align="right">
> > > >    <html:submit>
> > > >        <bean:message key="button.save"/>
> > > >    </html:submit>
> > > >   </td>
> > > >   <td align="left">
> > > >     <html:reset>
> > > >         <bean:message key="button.reset"/>
> > > >     </html:reset>
> > > >     &nbsp;
> > > >     <html:cancel>
> > > >       <bean:message key="button.cancel"/>
> > > >     </html:cancel>
> > > >     </td>
> > > > </table>
> > > > </html:form>
> > > >
> > > > My form consists of a getData().getRows().EmployeeName. The Rows is
> > the
> > > > array. I've added the appropriate getRows(int index) and setRows(int
> > > > index,
> > > > ...). Still, it doesn't work. Upon the post I do not see my getters
> > > being
> > > > called and I get no data in my corresponding form. Help???
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> 
> 
> 
> 

Reply via email to