Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<html:option> tag in STRUTS

843836Aug 27 2003 — edited Oct 31 2007
How can I put a "selected" attribute in the <html:option> tag in STRUTS? In regular HTML, I can say:

<select name="test">
<option name="opt1" selected>Option 1</option>
</selected>

But I can't use the "selected" key word in the STRUTS tag:

<html:select property="myList">
<logic:equal name="myListElement" value="Hello World">
<html:option value="opt1" selected>Option 1</html:option>
</logic:equal>
<logic:notEqual name="myListElement" value="Hello World">
<html:option value="other opts">Other opts</html:option>
</logic:notEqual>
</html:select>

How can I get the following to work?

Thanks,
Dylan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2007
Added on Aug 27 2003
4 comments
246 views