JSP Scriptlet to select option in selection list
843836Oct 25 2004 — edited Dec 24 2004I am trying to select the option in a selection list that is returned from a query to a database. Depending on the province that the customer lives in that option will be selected from the list in my HTML form on the JSP page.
<OPTION VALUE="Alberta" <%if (customer.getProvince().equals("Alberta")) {%> SELECTED <%}%> >Alberta</OPTION>
I know that the customer object exists because the rest of my form is populated with the correct values.
Any suggestions?