I wanted to know if with
struts 2 you can submit a key from <s:select and have it converted to an object, for example:
I have a state select box populated with:
List<State> stateList;
... stateList populated........
State is a class with:
int id;
String name;
Action has:
State state;
State getState() { return state; }
void setState(State state) { this.state = state; }
when I submit to Action
<s:select name="state" list='stateList' listValue="name" listKey="id" />
My state is NULL. I quess here state is submitted here as a String and not being converted to State object using a key lookup. Any way to select from list of States and receive a State without doing what we have to do with Struts 1, looking up the value to match to Object? Thanks a lot, hope it makes sense