jsp
aimosy
这个作者很懒,什么都没留下…
展开
-
jsp ${}无效
问题: <h3 class="box-title">采购订单${title}</h3>网页显示的也 <h3 class="box-title">采购订单${title}</h3> #${title}无效原因: 因为jsp servlet版本问题,2.3及2.3之前的版本isELIgnored默认是true,true即是EL表...原创 2018-08-05 15:09:33 · 2022 阅读 · 0 评论 -
对象属性值为null时,不返回该对象属性
在对象名上注解@JsonInclude(JsonInclude.Include.NON_NULL)原创 2018-09-13 20:52:41 · 8227 阅读 · 2 评论 -
前端传参给后台,转数据格式
在controller类中@InitBinderpublic void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringFormat());} class StringFormat extends PropertyEditorSupport{ ...原创 2018-09-13 20:50:55 · 2703 阅读 · 0 评论 -
iframe操作父级元素
var top = $(window.parent.document).find("#nav-top");$(top).find("li.active>i").click();原创 2018-09-06 20:36:27 · 1806 阅读 · 0 评论 -
锁定浏览器页面后退按钮
history.pushState(null, null, document.URL); window.addEventListener(‘popstate’, function () { history.pushState(null, null, document.URL); });原创 2018-09-06 20:32:44 · 286 阅读 · 0 评论 -
AdminLte DataTables warning: table id=table-data - Ajax error. For more information about this error
这个错误一般是colunm的赋值时有clounm的数据名没有对应的数据。原创 2018-08-29 22:58:00 · 4179 阅读 · 1 评论 -
AdminLte的常用方法
//制作表单var oTable = $('#table-data').dataTable({ serverSide:false, paging : false, //是否分页 searching: false, //是否查询 scrollY:&amp;amp;amp;quot;200&amp;amp;amp;quot;, //滚动条 scrol...原创 2018-08-29 21:24:43 · 4921 阅读 · 0 评论 -
根据方法名调用函数 eval传对象
根据方法名调用方法var obj = {"name":"张三","age",14};var funcName = "funcName";eval(funcName+"(obj);");//对象要在括号里不能用引号括着,如果参数是字符串则要用引号括着...原创 2018-08-29 21:13:44 · 1555 阅读 · 0 评论 -
JSON报错 SyntaxError: JSON.parse: expected property name or '}' at line 1 column 2 of the JSON data
String jsonRedirect = "{code:-101, msg:'没操作权限'}";//这里有错response.setContentType("application/json; charset=utf-8");response.getWriter().println(jsonRedirect );解决:改用双引号String jsonRedirect = "{\...原创 2018-08-30 23:21:14 · 11709 阅读 · 0 评论 -
json 转换错误:JSON.parse expected property name or '}'
String jsonRedirect = "{code:-101, msg:'没操作权限'}";response.setContentType("application/json; charset=utf-8");response.getWriter().println(jsonRedirect);解决:String jsonRedirect = "{\"code\":-101...原创 2018-08-30 22:40:53 · 5606 阅读 · 0 评论 -
设置web项目启动默认页面为controller方法
配置默认访问controller方法方法一: 在mvc配置文件中配置<!-- 定义无Controller的path<->view直接映射 --><mvc:view-controller path="/" view-name="redirect:login" />在web.xml配置文件中配置<welcome-file-list>...原创 2018-08-19 16:24:51 · 8949 阅读 · 5 评论 -
jsp注意项
1、设置radio选中时,用attr(“checked”,true)方法无效,需要用prop(“checked”,true)方法来设置。原创 2018-08-19 13:56:17 · 123 阅读 · 0 评论 -
jquery用attr("checked","checked")没有选中效果
要用prop()方法 $(“input[type=’radio’] [value=’0’]”).prop(“checked”,true);原创 2018-08-19 13:54:19 · 2399 阅读 · 0 评论 -
jsp遍历对象属性
var data = {"name":"张三","age":50};for(pro in data){}原创 2018-08-19 11:47:06 · 1715 阅读 · 0 评论 -
controller接收列表参数,List<Entity>
转https://blog.csdn.net/lightofsms/article/details/80722034$.ajax请求加请求头contentType: 'application/json;charset=utf-8'var data =[];data.push({username: "yss"});$.ajax({ type: "post", url: "...转载 2018-09-14 21:22:17 · 3822 阅读 · 0 评论