I have a combo box defined in JSP. So when I submit the page with multiple values selected in thsi combo box, I get "argument type mismatch exception" for the setter method defined in actionForm for this combo box. This method has a return type "Collection". Where do you think I am going wrong? What should be the return type here? I had String before but with I could get only the one value from the combo box (i.e first selected value).
Joined: Mar 18, 2008
Ok, Actionform accept only string arrays not collecion or arraylists...but why?
Originally posted by starts singh: Ok, Actionform accept only string arrays not collecion or arraylists...but why?
Because the HTML protocol only deals in Strings, not other Java object types. The Struts ActionForm setter method is taking as it's parameter input from an HTML form. The only type of data an HTML form understands is a String.