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!

JSP Scriptlet to select option in selection list

843836Oct 25 2004 — edited Dec 24 2004
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2005
Added on Oct 25 2004
5 comments
614 views