struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mittal, Nitin (US - Mumbai)" <>
Subject How to convert request parameters into Collection type - Set
Date Wed, 20 Jan 2010 14:08:42 GMT
I need help in mapping JSP text fields to a setter in action class which  have parameter as

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>
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:-

Nitin Mittal
Deloitte Consulting India Private Limited
cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1  615-718-8170 | Fax:+91 22 66445999

• 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]

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message