在有body中如何运用<c:if </c:if> 当test的值为1时则选中复选框 求详细解释!

解决方案 »

  1.   

    <c:if test="test==1">checked=true </c:if> 
      

  2.   

    <c:if test="${val == 1}">checked</c:if>
    这样用嘛,你可以把这段代码放到<input>标签的里面。
    这里的val是放到作用域范围中的值。
      

  3.   


      String gtj=(request.getParameter("gtj");
    这是从另一个页面获取它的值
    <td><input type="checkbox" name="checkjj2" id="checkjj2" <c:if test="$(val == 0 )">checked</c:if> />
          上架
          <input type="checkbox" name="checkjj1" id="checkjj1" <c:if test="test==1">checked=true </c:if>  />
          推荐
    这样不行啊