i am trying to build a project in which a user submits a ticket and can edit it later after submitting . on create ticket page there is a drop down menu for selecting priority of the ticket with options - highest,high,medium,low . there is a table in database for priority options . when user click on a edit link corresponding to a ticket , user is forwarded to an edit page where different fields of the ticket are shown populated . for showing the selected option for priority menu i am doing this , as follows
<select name="priority">
<c:forEach var="priority"items="${priorityList }">
<c:if test="${tempTicket.priorityId == priority.priorityId}">
<option value="${priority.priorityId }" selected="selected">${priority.priorityName}</option>
</c:if>
<option value="${priority.priorityId }">${priority.priorityName </option>
</c:forEach>
</select>
In this the selected option is shown two times in the drop down on the edit page , how can this be stopped ? is there any other way that can fullfill the same purpose ? i have tried using two <c:if>
.