开发者

Struts: HTML Option Selected?

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 optio开发者_运维问答n 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜