Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

READING MULTIPLE VALUES FROM HTML:SELECT STRUTS

Status
Not open for further replies.

orochiluis

Programmer
Nov 17, 2003
3
SV
I'm trying to set a collection of action form2 for an action form1 that looks this way

public actionform2 extends actionform{
String bvalue;
String bnoter;
//getters and setter provided
}

public actionform1 extends actionform{

String avalue;
String another;
actionform2 actions[];
//getters and setter provided for actions looks like this
actionform2[] getActions();
void setActions(actionform2[]);

}


and my jsp looks like this

<html:form>
<html:select property=&quot;actions&quot; multiple=&quot;true&quot;>
<html:eek:ptions collection=&quot;anarray&quot;
property=&quot;bnother&quot;
labelProperty=&quot;bvalue&quot;/>
</html:select>
</html:form>

but when i submit the jsp it shows an array typemistmatch exception :(

any help??
 

The type for multiple value should be String array. So action form should looks like:

Code:
String[] actions[];
public String[] getActions();
public void setActions(String[]);
 
there's no other way it could be Actionform2 type.. it would be more helpful that way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top