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();
springMVC中利用model在JSTL进行回填值的更多相关文章
- SpringMVC中的Model和ModelAndView的区别
1.主要区别 Model是每次请求中都存在的默认参数,利用其addAttribute()方法即可将服务器的值传递到jsp页面中:ModelAndView包含model和view两部分,使用时需要自己实 ...
- SpringMVC中利用HandlerExceptionResolver完成异常处理
在解决Controller层中的异常问题时,如果针对每个异常处理相对较为繁琐.在SpringMVC中提供了HandlerExceptionResolver用于处理捕获到的异常,从而重新定义返回给前端的 ...
- SSM-SpringMVC-31:SpringMVC中利用hibernate-validator做后台校验
------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 校验有三种:前台页面校验(例如js和h5),后台校验,数据库校验 但是一般能不用数据库校验就不用数据库校验,因 ...
- SpringMVC中利用@CrossOrigin注解解决ajax跨域请求的问题
1. 什么是跨域 跨域,即跨站HTTP请求(Cross-site HTTP request),指发起请求的资源所在域不同于请求指向资源所在域的HTTP请求. 2. 跨域的应用情景 当使用前后端分离,后 ...
- SpringMVC中利用@InitBinder来对页面数据进行解析绑定
同步发布:http://www.yuanrengu.com/index.php/springmvc-user-initbinder.html 在使用SpingMVC框架的项目中,经常会遇到页面某些数据 ...
- springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序
springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序 http://www.360doc.com/content/14/03 ...
- SpringMvc 你该知道如何在HandlerExceptionResolver中获取Model
在项目开发中,我们通常通过参数的形式注入Model对象,如: @RequestMapping("/demo") public String demo(Model model) { ...
- springMVC中的HttpSession与Model
目录 1.1 spring的@MODELATTRIBUTE 2.1 session的概念 3.1 示例 4.1 为什么springmvc框架要使用model这个对象呢? 突然发问:相信很多人在做WEB ...
- spring学习之springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序
spring mvc处理方法支持如下的返回方式:ModelAndView, Model, ModelMap, Map,View, String, void.下面将对具体的一一进行说明: ModelAn ...
随机推荐
- hadoop2.2.0 + hbase 0.94 + hive 0.12 配置记录
一开始用hadoop2.2.0 + hbase 0.96 + hive 0.12 ,基本全部都配好了.只有在hive中查询hbase的表出错.以直报如下错误: java.io.IOException: ...
- Android 读取蓝牙设备信息开发
(1)Android手机一般以客户端的角色主动连接SPP协议设备(接上蓝牙模块的数字传感器),连接流程是: 1.使用registerReceiver注册BroadcastReceiver来获取蓝牙状态 ...
- [总结]HNOI2015省队选拔
// 此博文为迁移而来,写于2015年4月21日,不代表本人现在的观点与看法.原始地址:http://blog.sina.com.cn/s/blog_6022c4720102vy9t.html 这次省 ...
- tornado 学习笔记2 Python web主流框架
2.1 Django 官方网址:https://www.djangoproject.com/ 简介:Django is a high-level Python Web framework that e ...
- 【bzoj2333】 [SCOI2011]棘手的操作 可并堆+lazy标记
2016-05-31 21:45:41 题目:http://www.lydsy.com/JudgeOnline/problem.php?id=2333 (学习了黄学长的代码 有如下操作: U x y ...
- Ajax注册验证js代码
分享jquery网站:http://www.css88.com/jqapi-1.9/focusout/ $(document).ready(function() { var bool_user = f ...
- (转) 使用Speech SDK 5.1文字转音频
下载地址: http://www.microsoft.com/en-us/download/details.aspx?id=10121 SeppchSDK51.exe 语音合成引擎 SpeechSDK ...
- Nodejs正则表达式函数之match、test、exec、search、split、replace使用详解
1. Match函数 使用指定的正则表达式函数对字符串惊醒查找,并以数组形式返回符合要求的字符串 原型:stringObj.match(regExp) 参数: stringObj 必选项,需要去进行匹 ...
- C# async
I/O should use async, asynchronous method can be achieved: message, delegate, multi-threading Thread ...
- ellipsis
语法: text-overflow : clip | ellipsis 参数: clip : 不显示省略标记(...),而是简单的裁切(clip这个参数是不常用的!) ellipsis ...