找不到WeaponList名下的bean。

问题描述 投票:0回答:1
 <html:select property="Weapon">
   <html:options collection="WeaponList" property="weaponIDPK" labelProperty="weaponName" />
 </html:select>

我在Struts中创建了一个下拉列表来显示不同的武器,但我得到了这个错误。

你能不能告诉我缺失的部分是什么?或者可能出现的错误,我需要修改我的Action文件吗?

我在这部分有问题

collection="WeaponList"
java hibernate jsp struts2 struts
1个回答
2
投票

S2:

缺少的部分是 WeaponList,应命名为 weaponList并在动作中通过一个普通的JavaBean风格的getter暴露出来。getWeaponList.


S1:

收集的资料需要在 ActionForm.


要么。

命名应该遵循标准的JavaBean惯例,例如,第一个字母应该是小写的,原因有很多。


不相关:你有足够的SO代表知道如何提出一个好问题(以及问题应该如何命名)。除了提供有根据的猜测,你没有提供任何人可以用来帮助的东西。

© www.soinside.com 2019 - 2024. All rights reserved.