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.
精彩评论