比较并设置下拉列表中的选定值?

Compare and set the selected value in drop down list?

我用过动态下拉列表。现在在该列表中我需要设置选定的值。

我正在从我的控制器中为我的 asp 获取选定的值,它是这样的,

<c:set var="Questions" value='${map["Questions"]}' />

下面分享的是我的下拉列表的源代码。

<tr>
<c:set var="questionids" value="Select Question,Visit Dentist?,Age (40+),Drinker?,Smoker?" scope="application"/>
<select name="questionid" id="questionids" >
       <c:forEach items="${fn:split(questionids, ',')}" var="questionids">
         <option value="${questionids}">${questionids}</option>
       </c:forEach>
</select>
</tr>

现在我该如何比较列表中的应该选择值。

我怎样才能实现同样的。

尝试检查选定的索引,如果它是 0,然后显示 "Select Question"[假设下拉列表的第一个条目是 "Select Question"],否则您可以根据索引将相应选项的选定属性设置为 true'重新获得。