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();

springMVC中利用model在JSTL进行回填值的更多相关文章

  1. SpringMVC中的Model和ModelAndView的区别

    1.主要区别 Model是每次请求中都存在的默认参数,利用其addAttribute()方法即可将服务器的值传递到jsp页面中:ModelAndView包含model和view两部分,使用时需要自己实 ...

  2. SpringMVC中利用HandlerExceptionResolver完成异常处理

    在解决Controller层中的异常问题时,如果针对每个异常处理相对较为繁琐.在SpringMVC中提供了HandlerExceptionResolver用于处理捕获到的异常,从而重新定义返回给前端的 ...

  3. SSM-SpringMVC-31:SpringMVC中利用hibernate-validator做后台校验

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 校验有三种:前台页面校验(例如js和h5),后台校验,数据库校验 但是一般能不用数据库校验就不用数据库校验,因 ...

  4. SpringMVC中利用@CrossOrigin注解解决ajax跨域请求的问题

    1. 什么是跨域 跨域,即跨站HTTP请求(Cross-site HTTP request),指发起请求的资源所在域不同于请求指向资源所在域的HTTP请求. 2. 跨域的应用情景 当使用前后端分离,后 ...

  5. SpringMVC中利用@InitBinder来对页面数据进行解析绑定

    同步发布:http://www.yuanrengu.com/index.php/springmvc-user-initbinder.html 在使用SpingMVC框架的项目中,经常会遇到页面某些数据 ...

  6. springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序

    springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序 http://www.360doc.com/content/14/03 ...

  7. SpringMvc 你该知道如何在HandlerExceptionResolver中获取Model

    在项目开发中,我们通常通过参数的形式注入Model对象,如: @RequestMapping("/demo") public String demo(Model model) { ...

  8. springMVC中的HttpSession与Model

    目录 1.1 spring的@MODELATTRIBUTE 2.1 session的概念 3.1 示例 4.1 为什么springmvc框架要使用model这个对象呢? 突然发问:相信很多人在做WEB ...

  9. spring学习之springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序

    spring mvc处理方法支持如下的返回方式:ModelAndView, Model, ModelMap, Map,View, String, void.下面将对具体的一一进行说明: ModelAn ...

随机推荐

  1. 使用linux命令行配置无线网链接

    1. 需安装wpa_supplicant https://wiki.archlinux.org/index.php/WPA_Supplicant_%28%E7%AE%80%E4%BD%93%E4%B8 ...

  2. gulp + webpack 构建多页面前端项目

    修改增加了demo地址 gulp-webpack-demo 之前在使用gulp和webpack对项目进行构建的时候遇到了一些问题,最终算是搭建了一套比较完整的解决方案,接下来这篇文章以一个实际项目为例 ...

  3. Android -- ListView(SimpleAdapter) 自定义适配器

    aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA ...

  4. windows与linux之间传输文件

    1.使用SSH Secure Shell Client 百度网盘 下载地址 http://pan.baidu.com/s/1kTmp00J 2.使用pscp 百度网盘地址:http://pan.bai ...

  5. JDBC学习笔记2

    数据库数据更新操作statement接口下操作:[代码] import java.sql.DriverManager;import java.sql.SQLException; public clas ...

  6. JAVA生成带Logo的二维码

    1.下载生成二维码所需要的jar包qrcode.jar: 2.直接上生成二维码的java代码 //需要导入的包 import java.awt.Color;import java.awt.Graphi ...

  7. Implement strStr()

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...

  8. TCP和UDP的聊天

    TCP聊天 TCP(Transmission Control Protocol,传输控制协议)是基于连接的协议. 1.一个TCP连接必须要经过三次"对话"才能建立起来,其中的过程非 ...

  9. MySQL Command 常见命令

    /* Load data from txt file */ LOAD DATA LOCAL INFILE "D:/data.txt" INTO TABLE tname; /* Lo ...

  10. JQ写法和js写法 方法函数化

    <script> $(function () { $('#head').click=function () { alert($(this).html()) } }) </script ...