That might work for Set's where order isn't important, but how would you populate a Liist? I've never had good luck there. (*Chris*)
On Wed, Jan 20, 2010 at 5:18 AM, Steven Yang <kenshin...@gmail.com> wrote: > simply loose the "[n]" just have all fields with name "middleNames" > > On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) < > nimit...@deloitte.com> wrote: > > > Hi, > > I need help in mapping JSP text fields to a setter in action class which > > have parameter as Set<String> > > > > I know Struts 2 supports automatically converting sets of request > > parameters into properties of various Collection type Lists > > This can be done by having a setter in the action class as - > > setMiddleNames(ArrayList<String> middleNames) > > JSP code should contain text fields as follows:- > > <s:textfield name="middleNames[0]" label="middleNames"/> > > <s:textfield name="middleNames[1]" label="middleNames"/> > > <s:textfield name="middleNames[2]" label="middleNames"/> > > > > Question :- How to map JSP text Fields or Hidden fields to setters in > > Action class which have parameter as Set<String> > > > > For example, how should I define text fields in JSP so that they can be > > mapped to the following setter in Action Class:- > > setMiddleNames(Set<String>) > > > > > > Thanks, > > Nitin Mittal > > Deloitte Consulting India Private Limited > > cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | > > Fax:+91 22 66445999 > > nimit...@deloitte.com > > > > • Please consider the environment before printing. > > > > > > > > This message (including any attachments) contains confidential > information > > intended for a specific individual and purpose, and is protected by law. > If > > you are not the intended recipient, you should delete this message. > > > > Any disclosure, copying, or distribution of this message, or the taking > of > > any action based on it, is strictly prohibited. [v.E.1] > > > > >