zoukankan      html  css  js  c++  java
  • springMVC中利用model在JSTL进行回填值

    1、ringMVC中利用model回填值
      后台中,利用model返回值,如 model.addAttribute("MS_info" , MS_info);
      前台回填值:
      text : <input type="text" name="dangerousSourceName" class="input-text" size="50" value="${MS_info.dangerousSourceName}">
      radio : <b><input type="radio" name="dangerousSourceType" value="锅炉" <c:if test="${MS_info.dangerousSourceType eq '锅炉'}"> checked</c:if> >锅炉</b>
      select option :
      <option <c:if test="${fn:contains(MS_info.dangerousSourceLevel,'一级')}"> selected="selected"</c:if> value="一级">一级</option>
      <option <c:if test="${fn:contains(MS_info.dangerousSourceLevel,'二级')}"> selected="selected"</c:if> value="二级">二级</option>
      textarea : <textarea rows="5" cols="50" name="ms_tailings.questionAndSolution">${ms_Tailings.questionAndSolution}</textarea>
      checkbox : <input type="checkbox" <c:if test="${fn:contains(enterprise.companyProperty,'国有')}"> checked="checked" </c:if> name="companyProperty" value="国有">

      有时候直接写<c:if test="${check.ck_duinfo == ''}">判断空会出错,本应为空,但结果却不为空,出现bug。这时用下面的写法
      <c:if test="${empty check.ck_duinfo}"> check.ck_duinfo为空</c:if>
      <c:if test="${not empty check.ck_duinfo}"> check.ck_duinfo不为空</c:if>

      <c:forEach varStatus="status">中 varStatus的属性简介
        ${status.index} 输出行号,从0开始。
        ${status.count} 输出行号,从1开始。
      </c:forEach>

      //知道radio的值,让对应的radio选中
      $("input[name='haveopinion'][value=有]").attr("checked",true);
      //获取radio的值
      var state = $('input[name="audit_pass_dept"]:checked').val();

  • 相关阅读:
    树形结构菜单,递归实现
    基于Vue的日历组件,可以标注重要日子
    关于element-ui级联菜单(城市三级联动菜单)和回显问题
    继承(面试问到)
    vue监听浏览器刷新
    Popover 弹出框,里面的表格点击后关闭弹窗
    el-table表格合并单元格
    对角线
    ElementUI中el-radio再次点击取消选中
    保留文本框换行和空格
  • 原文地址:https://www.cnblogs.com/chenrunlin/p/4971641.html
Copyright © 2011-2022 走看看