正如我们在评论中讨论的那样,
categoryList应该
Category与getter / setter一起使用
List<Category> categoryList
然后在你的jsp中
<s:select label="Select Category :" name="cid" id="cid" list="categoryList" listKey="id" listValue="name"/>
现在,在您的表单中声明一个隐藏字段,以便
cname通过
cid
<s:hidden name="cname" id="cname"/>
jQuery代码 (根据您的要求)进行设置
cname
$("#cid").change(function(){ $("#cname").val($(this).find("option:selected").text());});需要声明
cid与
cname您的变量(用的getter / setter)
NewQuestion行动



