私のフォームは国の文字列名をアクションに渡しています。オブジェクトの国のIDをコンボボックスからアクションに渡すにはどうすればよいですか?
これは私が持っているものです:
s:combobox label="Country" name="country" headerValue="Select" headerKey="1" list="%{countries}" listValue="name"/>
ありがとう。
listKey属性がありません。次のように変更した場合:
<s:combobox label="Country" name="country" headerValue="Select" headerKey="1"
list="%{countries}" listValue="name" listKey="id"/>
それはおそらくうまくいくでしょう。
See http://struts.apache.org/2.0.14/docs/combobox.html for all the attributes available.