struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Ventura <vent...@cit.com.br>
Subject Re: Multiple HTML Fields -> Mapping To ActionForm
Date Thu, 17 Apr 2003 13:07:35 GMT
I've tried this but it didn't work. I had to use the following:

public Object[] getFirstName();
public void setFirstName(Object[] values);

When I get the value, though, it returns a String[]. Weird.

[]'s
- never mind me i'm a newbie

----- Original Message ----- 
From: "Max Cooper" <max@maxcooper.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Wednesday, April 16, 2003 8:50 PM
Subject: Re: Multiple HTML Fields -> Mapping To ActionForm


> These method signatures will work:
> 
> public String[] getFirstName();
> public void setFirstName(String[] values);
> 
> -Max
> 
> ----- Original Message ----- 
> From: "Aidan Monroe" <kms_struts@yahoo.com>
> To: "list" <struts-user@jakarta.apache.org>
> Sent: Wednesday, April 16, 2003 4:08 PM
> Subject: Multiple HTML Fields -> Mapping To ActionForm
> 
> 
> > I've been working on this all day and can't get it to
> > work. I've searched the archives and have seen similar
> > questions asked, but no exact matches so I'm hoping
> > someone can provide me a simple answer.
> > 
> > If I have an web page that can have multiple
> > occurrences of the same named input field, how do I
> > get that to map to my ActionForm bean when the HTML
> > form is submitted? This has to be easy, but after 6
> > hours of trying I need to ask for help.
> > 
> > In my HTML I have:
> > 
> > <tr><td><input type="text" name="firstName"></td></tr>
> > <tr><td><input type="text" name="firstName"></td></tr>
> > <tr><td><input type="text" name="firstName"></td></tr>
> > <tr><td><input type="text" name="firstName"></td></tr>
> > 
> > Can someone please tell me what to define in my
> > ActionForm as the data type for "firstName" (is it
> > ArrayList, Collection, String[]...?) and how to code
> > my get/set methods? 
> > 
> > Please note that at this point all I am concerned with
> > is getting the data from HTML into the form. For this
> > particular page I have no intention of every
> > displaying the data in HTML so retrieving it via
> > <logic:iterate> is not applicable.
> > 
> > I've seen all kinds of things mentioned in the
> > archives, all of which I've tried but nothing seems to
> > work. I either get "argument mismatch" exceptions, or
> > empty forms. I'm real confused.
> > 
> > TIA.
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo
> > http://search.yahoo.com
> > 
> > ---------------------------------------------------------------------
> > 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


Mime
View raw message