I have a simple drop down box with the select item out of db
like if the value in my db is i then the user will see two line of <option value="1">1</option>,
is that a simple way to handle this problem?
<select name="year">
<option selected value="${found.year}"> <c:out value="${found.year}"/></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
I don't want to use the method
<c:if test="${found.year=='1'}">
<option value="1" selected>1</option>
<c:if test="${found.year!='1'}">
<option value="1" >1</option>
since if the select list is long , like to 100 then the code will turn to every long , should be have a better way , is that right??