statesList is ArrayList that contains String object.
String[] states = new String[2];
states[0] = "CA";
states[1] = "California";
statesList.add(states);
//---
<s:select list="statesList" headerKey="" headerValue="Select State" name="state"开发者_C百科 listKey="?" listValue="?" />
What to mention in listKey and listValue??
Your statesList
is ArrayList
that contains String[]
object, instead of String
.
With this said you can change your code to:
Map<String,String> statesList= new HashMap()<String,String>;
statesList.put("CA","California");
<s:select list="statesList" headerKey="" headerValue="Select State" name="state" listKey="key" listValue="value" />
精彩评论