Here is a reply I made to an earlier post on the same subject:

This topic has been addressed *numerous* times on this list.  However, I understand 
what a PITA searching on mail-archive is, so here goes:

Firstly take a look at the html-select.jsp that is part of the struts-exercise-taglib 
application that ships with struts.  It should answer all your questions.

In summary, the value that you see selected by default corresponds to the current 
value of the property identified by the 'property' attribute.  So, if you have 

<html:select name="foo" property="role">
  <html:option value="emp">Employee</html:option>
  <html:option value="mgr">Manager</html:option>
  <html:option value="stu">Student</html:option>
  <html:option value="sec">Security</html:option>
</html:select>

and the value of the property 'role' in the bean 'foo' is set to 'stu', then when the 
page displays the displayed (in the case of select of size 1) value will be 'Student'.

HTH

Sri

-----Original Message-----
From: Cathy Osekizoglu [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 04, 2002 2:57 PM
To: Struts Users Mailing List
Subject: How to set default



 I am using <html:options> tag to get a dropdown list. How can I make an item as 
default so every time I open the page that contains the dropdown list, it will show 
the default. Thanks. Cathy



---------------------------------
Post your free ad now! Yahoo! Canada Personals

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to