You can also set it to an ArrayList
<form property name="abc" type="java.util.ArrayList"
Main Topics
Browse All TopicsDear experts
1) I have this in my jsp
<html:select property="abc" multiple="multiple"/>
Values in this field are populated on page load which are coming from the database.
2) I have this in my form bean
<form-bean name="Form" type="org.apache.struts.va
<form-property name="abc" type="java.lang.String"/>
</form-bean>
My requirment: I am selecting multiple values in my above <html:select> field
and i want to store all the values in an Array / ArrayList in my action class.
any ideas how i can approach on this
thanks
J
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ok got it.
but how do i get the array/arraylist values in my action class?
public ActionForward getArrayValues(ActionMappi
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
DynaValidatorForm f = (DynaValidatorForm) form;
f.???? //What do i do here to get all the values which user selected in the <html:select property="selectedvalues" multiple="multiple" width="40"> ?
return mapping.findForward("succe
}
any help greatly appreciated.
thanks
J
Business Accounts
Answer for Membership
by: fargoPosted on 2006-05-19 at 00:13:55ID: 16715672
you can use String[] for form property
>
<form-property name="abc" type="java.lang.String[]"/