<select id="type" name="type" datatype="*">
                             <c:forEach items="${types}" var="item">
                            <c:if test="${item.code=='0200'}">
                            <option value="${item.code}" selected="selected">${item.name}</option>
                            </c:if>
                            <c:if test="${item.code!='0200'}">
                            <option value="${item.code}" >${item.name}</option>
                            </c:if>
                             </c:forEach>

                          </select>

用<c:if>标签进行判断。如果符合,则加上selected="selected"表示在框中自动显示。


本文转载:CSDN博客