下拉框中有三个选项,“--”、“是”、“否”。“--”为默认。
若选择“是”保存后,重新打开页面,仍然是“--”。数据库中值已改。
请问应该怎么做?

解决方案 »

  1.   


    <select name="selectName" style="width:153px">
        <option <c:if test="${selectName=='是'}">selected</c:if> value="是">是</option>
        <option <c:if test="${selectName=='否'}">selected</c:if> value="否">否</option>
    </select>
      

  2.   

    请问是这样子的吗?怎么报错啊?<html:select property = "$zzyh" onkeydown="if(event.keyCode==13)event.keyCode=9">
    <html:option <c:if test="${$zzyh==''}">selected</c:if> value="">--</html:option>
    <html:option <c:if test="${$zzyh=='1'}">selected</c:if> value="1">是</html:option>
    <html:option <c:if test="${$zzyh=='0'}">selected</c:if> value="0">否</html:option>
    </html:select>
      

  3.   

    <html:select property = "$zzyh" value="--">
        <html:option value="--"></html:option>
        <html:option value="是"> </html:option>
        <html:option value="否"> </html:option>
    </html:select>
      

  4.   

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
     我用的是這個哦
      

  5.   

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 是標簽
    1.添加jstl包
    2.寫在JSP頁面的開頭
    3使用標簽就是前面發的那個