java日常工作错误总结

Wesley13
• 阅读 462

1.将一个新的项目拷贝到另一台电脑上,放入tomcat中运行找不到路径,报错404、重新创建一个servlet运行就可以正常访问到。

2.但上传的文件过大时上传文件会报404错误 把 限制该大些就能正常上传文件

 
 

   

3.//将获取的from表单中的数据组装成 json格式

var data = $('#usingProdctMsgform').serializeArray();
//alert(JSON.stringify(data));
var json={};
for(var i=0;i<data.length;i++){
json[data[i]['name']]=data[i]['value'];
}
//alert(JSON.stringify(json));

4.jsp中移出某个div或者标签

$('body>.easyui-fluid').remove();

$('.easyui-fluid').remove();

清空提个table中的数据 $('#addusingprodcetheal').datagrid('loadData', {total: 0, rows: []});

5.树状结构多线框=====

$('#relevant_information').combotree({
valueField: "id", //Value字段
textField: "text", //Text字段
multiple: true,
data: [{"id": '01', "text": "吸烟史"}, {
"id": '02',
"text": "饮酒史"
}, {"id": '03', "text": "妊娠期"}, {
"id": '04',
"text": "肝病史"
}, {"id": '05', "text": "肾病史"}, {
"id": '06',
"text": "过敏史"
}, {"id": '07', "text": "其他"}],
// url: "tree_data2.json", //数据源
onCheck: function (node, checked) {

if(node.id=='06' && checked){
$('#allergen').validatebox({
required: true
});
$("#allergen").removeAttr("readonly");

}
if(node.id=='06' && !checked){
document.getElementById("allergen").setAttribute("readonly",true);
$('#allergen').validatebox({
required: false
});
}

//让全选不显示
/* $("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", "")); */
},
onClick: function (node, checked) {
//让全选不显示
/* $("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", "")); */
}
});

6.模糊查询 筛选 

/修改模糊查询 req_desc like '%%${qry_req_desc}%%'
and (bus_no like '%%${ctt_no}%%' or bus_nm like '%%${ctt_no}%%')//同一个字段多个字段筛选
and (bus_nm like '%%${ctt_nm}%%' or #{ctt_nm} = '')
and (#{bus_select}='' OR bus_select=#{bus_select})
and (#{beg_date} ='' or tr_date >=#{beg_date}) and (#{end_date} ='' or #{end_date} >=tr_date)
order by tm_smp desc

//下拉框设置默认选中项
$("#sel").val(Array('1','2'));//设置value=1和2的选项为默认选中
//移出div=====
$('.easyui-fluid').remove();

//easy-UI通过combotree实现下拉框多选==================
//月份下拉框
$('#ddlLine').combotree({
valueField: "id", //Value字段
textField: "text", //Text字段
multiple: true,
url:"/static/a.json",
onCheck: function (node, checked) {
//让全选不显示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
},
onClick: function (node, checked) {
//让全选不显示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
}
});
json值
[{ "text": "All", "children": [{ "text": "1" }, { "text": "2" }, {"text": "3"},{"text": "4"},{"text": "5"},{"text": "6"},{"text": "7"},{"text": "8"},{"text": "9"},{"text": "10"},{"text": "11"},{"text": "12"}]}]

//============================开始时间到期时间
function calDeadline(){
var timestemp = parseInt($("#pay_period option:selected").text().split("年")[0]);
if($('#pay_time').datebox('getValue')==""||$('#pay_time').datebox('getValue')==null){return;}
var arr = $('#pay_time').datebox('getValue').split("-");
var year = parseInt(arr[0]);
var month = parseInt(arr[1]);
var day = parseInt(arr[2]);
$('#due_date').datebox('setValue',year+timestemp+'-'+month+'-'+(day-1));
}
//交费时间
$('#pay_time').datebox({
required:false,
editable:false,
onSelect: function(date){
var timestemp = parseInt($("#pay_period option:selected").text().split("年")[0]);
$('#due_date').datebox('setValue',date.getFullYear()+timestemp+'-'+(date.getMonth()+1)+'-'+(date.getDate()-1));
}
});
$('#pay_time').datebox('textbox').attr('placeholder', '请选择交费时间');
$('#pay_time').datebox('calendar').calendar({
validator:function(date){
var now = new Date();
var d1 = new Date(now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate());
return date <= d1;
}
});

//打开弹框钱先查询这条数据是否有效==========================object转成string string转换成json

var htmlobj=$.ajax({url:"<%=basePath%>xyData/badSurvey/findSurveyTrigger.do?sur_id="+row.sur_id,async:false});
//object 转string htmlobj.responseText
//string转json
var str=JSON.parse(htmlobj.responseText)
//alert(str.row.flag)
//$("#myDiv").html(htmlobj.responseText);
if(1!=str.row.flag){
$.messager.show({
title: '提示',
msg: '数据为无效状态,无法进行不良调查!',
showType: 'show'
});
return;
}

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Wesley13 Wesley13
2年前
Java爬虫之JSoup使用教程
title:Java爬虫之JSoup使用教程date:201812248:00:000800update:201812248:00:000800author:mecover:https://imgblog.csdnimg.cn/20181224144920712(https://www.oschin
Wesley13 Wesley13
2年前
Java日期时间API系列31
  时间戳是指格林威治时间1970年01月01日00时00分00秒起至现在的总毫秒数,是所有时间的基础,其他时间可以通过时间戳转换得到。Java中本来已经有相关获取时间戳的方法,Java8后增加新的类Instant等专用于处理时间戳问题。 1获取时间戳的方法和性能对比1.1获取时间戳方法Java8以前
Wesley13 Wesley13
2年前
thinkphp3.2.3模板渲染支持三元表达式
thinkphp3.2.3模板渲染支持三元表达式{$status?'正常':'错误'}{$info'status'?$info'msg':$info'error'}注意:三元运算符中暂时不支持点语法。如下:           <divclass"modalhidefade"id'myModa
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Wesley13 Wesley13
2年前
Java多线程导致的的一个事物性问题
业务场景我们现在有一个类似于文件上传的功能,各个子站点接受业务,业务上传文件,各个子站点的文件需要提交到总站点保存,文件是按批次提交到总站点的,也就是说,一个批次下面约有几百个文件。      考虑到白天提交这么多文件会影响到子站点其他系统带宽,我们将分站点的文件提交到总站点这个操作过程独立出来,放到晚上来做,具体时间是晚上7:00到早上7:00。
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这