我正在尝试在HTML下拉列表中禁用的东西列表中设置某些值。我将其从optionsCollection更改为options,但是我试图处理LabelValueBean本身,而不仅仅是将值更改为项目。我不太确定我是否掌握了struts / jsp的“属性”或“集合”的含义
例如。
thinglist = [LabelValueBean [AAA [苹果,树],AAA],LabelValueBean [BBB [香蕉,香草],BBB],LabelValueBean [CCC [哈密瓜,瓜],CCC]]
我有什么:
<select>
<option value="">nothing</option>
<option value="LabelValueBean[AAA[apple,tree],AAA]">LabelValueBean[AAA[apple,AAA]</option>
<option value="LabelValueBean[BBB[banana,herb],BBB]">LabelValueBean[BBB[banana,BBB]</option>
<option value="LabelValueBean[CCC[cantaloupe,melon],CCC]">LabelValueBean[CCC[cantaloupe,CCC]</option>
</select>
(最终)我想要什么:
<select>
<option value="">nothing</option>
<option value="AAA">AAA[apple,tree]</option>
<option value="BBB">BBB[banana,herb]</option>
<option value="CCC" disabled="true">CCC[cantaloupe,melon]</option>
</select>
这是我的jsp中的代码
<html:select property="thing">
<html:option value="">nothing</html:option>
<html:options property="thinglist">
</html:select>
原始代码:
<html:select property="thing">
<html:option value="">nothing</html:option>
<html:optionsCollection property="thinglist">
</html:select>