This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The <html:select> tag will show the option as "selected" that matches the current value of the ActionForm bean property that is specified in the "property" attribute of the tag.
So, if you want to set a default value, you have to set the ActionForm bean property. In your example, let's suppose that "01" is the key value for "Entree" and that myActionForm is a local variable that refers to your ActionForm bean, the following statement would do the job:
Here are your options:
1- If a particular value is always supposed to be the default value, you can set this value in the reset() method of the ActionForm bean.
2- You can set it in an Action class that forwards to the JSP
3- You can set it in the JSP itself with a <c:set> tag. [ August 18, 2006: Message edited by: Merrill Higginson ]