Ok let me put in this way.
Say you provide an user an option to select multiple values for an input element(say a list box)
< html:select name="userForm" property="userGroups" size="5" multiple="true" >
< html
ptions collection="groupsList" property="groupCode" labelProperty="name" / >
< / html:select >
The property userGroups under the formbean should be declared as String[]
//used by struts
String[] userGroups;
//can be used in the action
List<String> userGroupList =new ArrayList();
public void setUserGroups(String strings[])
{
Collection list = new ArrayList();
for(int i = 0; i < strings.length; i++)
if(strings[i] != null)
{
list.add(strings[i]);
}
setUserGroupList(list);
userGroup = strings;
}
public String[] getUserGroup()
{
return userGroup;
}
public List<String> getUserGroupList(){
return userGroupList;
}
public void setUserGroupList(List<String> groupList){
this.userGroupList=groupList;
}
so whenever the page is rendered struts uses the String[] property and you can use the arraylist property in your action.
[ December 28, 2006: Message edited by: Kamesh Rao ]