简体   繁体   中英

Cannot find bean under name WeaponList

 <html:select property="Weapon">
   <html:options collection="WeaponList" property="weaponIDPK" labelProperty="weaponName" />
 </html:select>

I'm creating a drop-down list to display different weapons in Struts and I'm getting this error.

Can you tell me what are the missing pieces? Or possible errors? Do I need to fix my Action file?

Im having problem on this part

collection="WeaponList"

S2:

The missing piece is WeaponList , which should be named weaponList , and exposed in the action via a normal JavaBean-style getter, getWeaponList .


S1:

The collection needs to be available in the ActionForm .


Either:

Naming should follow standard JavaBean conventions, eg, the first letter should be lower-cased, for a variety of reasons.


Unrelated: you have enough SO rep to know how to ask a good question (and how questions should be titled). You've provided nothing anyone can use to help other than providing educated guesses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM