开发者

Struts: HTML Option Selected?

开发者 https://www.devze.com 2023-04-02 02:48 出处:网络
In struts, it seems there is no \"selected\" option. The HTML option tag has a selected attribute such that you can do:

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

精彩评论

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