Struts:选择HTML选项? [英] Struts: HTML Option Selected?
问题描述
< option selected =selected> Some Option< ; /选项>
并且该选项将被自动选择。有没有办法在struts中做到这一点?看来,在struts中,它随机自动选择一个我的选项,我不明白的原因,我想能够指定哪个选项应该自动选择。
< html:option>
类似于纯HTML 选项
。 值 nofollow> < html:select>
标记用于比较每个< html:option>
值并在找到匹配项时将其标记为选中。
In struts, it seems there is no "selected" option. The HTML option tag has a selected attribute such that you can do:
<option selected="selected">Some Option</option>
and that option will be automatically selected. Is there a way to do this in struts? It seems that in struts, its randomly auto-selected one my options for a reason I don't understand and I would like to be able to specify which option should be auto selected.
In Struts this is done in the <html:select>
tag and not in the <html:option>
like for the the case of plain HTML option
.
The value
attribute of the <html:select>
tag is used to compare against each <html:option>
value and marking it as selected if a match is found.
这篇关于Struts:选择HTML选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!