0

私のフォームは国の文字列名をアクションに渡しています。オブジェクトの国のIDをコンボボックスからアクションに渡すにはどうすればよいですか?

これは私が持っているものです:

s:combobox label="Country" name="country" headerValue="Select" headerKey="1" list="%{countries}" listValue="name"/>

ありがとう。

4

1 に答える 1

1

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.

于 2009-03-26T20:59:39.900 に答える