Hibernate中的sql查出的数据不能写别名,否则报错
easyui datagrid 去掉 全选checkbox
在加载 表格的时候添加事件:onLoadSuccess
在事件中写入下面句,用空代替原有HTML 达到取消效果。
$(".datagrid-header-check").html("");
在一个页面上使用多个Ueditor
var editor =new UE.ui.Editor(); //实例化第一个ueditor
editor.render("editor");//追加到页面
var image= new UE.ui.Editor({ //实例化第二个编辑器,并自定义按钮
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars:[['insertimage', 'Undo', 'Redo']],
//focus时自动清空初始化时的内容
autoClearinitialContent:false,
//关闭字数统计
wordCount:false,
//不可以编辑
// readonly:true,
//关闭elementPath
elementPathEnabled:false,
//禁用浮动
autoFloatEnabled: false,
//默认的编辑区域高度
initialFrameHeight:300
//更多其他参数,请参考ueditor.config.js中的配置项
});
image.render("imageEditor");//追加到页面
html代码
<script type="text/plain" name="image" id="imageEditor"></script>//此编辑器只启用上传图片功能
<script type="text/plain" name="commodityDesc" id="editor"></script>//此编辑器包含所有功能
setInterval(isFocus, 100);//时刻检测image编辑器有没有获取焦点,若获取则使其失去焦点,达到禁止输入的目的,不过此种做法不好,若用户输入的快,还是可以输入的,
function isFocus(){
if(image.isFocus()){
image.blur();
}
}
js将数字(如1406419200000)转为本地时间
var dt = new Date("1406419200000");
var y = dt.getFullYear();
var m = dt.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = dt.getDate();
d = d < 10 ? ('0' + d) : d;
var h = dt.getHours();
var minute = dt.getMinutes();
minute = minute < 10 ? ('0' + minute) : minute;
var date = y + '-' + m + '-' + d+' '+h+':'+minute;
var seconds = dt.getSeconds();
seconds = seconds < 10 ? ('0' + seconds) : seconds;
var data= y + '-' + m + '-' + d+' '+h+':'+minute+':'+seconds;
return data;
js将日期字符串转化为时间进行比较,支持IE
new Date(Date.parse(data.replace(/-/g, "/"))) < new Date() //data为需要转换的数据,判断是否小于当前时间
new Date(Date.parse(data.replace(/-/g, "/"))) < new Date() //data为需要转换的数据,判断是否小于当前时间
在JAVA项目中链接标签如果前面没有加http://,在运行后会被系统自动加上系统自认为的前缀
eg:只写了/user/info 则项目在其前面自动加上http://ip:port/项目名 最后变成: http://ip:port/项目名//user/info
jsp页面读取配置文件
首先引入包<%@ page import="java.io.*,java.util.* " %>
页面中的java代码
<%
Properties pro = new Properties();
String realpath = request.getRealPath("/WEB-INF/classes");
try{
//读取配置文件
FileInputStream in = new FileInputStream(realpath+"/application-prod.properties");
pro.load(in);
}catch(FileNotFoundException e){
out.println(e);
}catch(IOException e){out.println(e);}
//通过key获取配置文件
String path = pro.getProperty("hostIpAddress");
%>
<%=path %>
java中时间的加减操作
Calendar cd = Calendar.getInstance();
cd.setTime(new Date());
cd.add(Calendar.HOUR, -1);//当前时间减1小时
cd.add(Calendar.MONTH, -1);//当前月份减1个月
cd.add(Calendar.HOUR, 1);//当前时间加1小时
Systom.out.println(cd.getTime());//转化为时间格式输出
jpa 数据层,模糊查询
@Query("select u from Document u where u.documentTitle like CONCAT('%',?1,'%') AND u.isDeleted=0 ")
List<Document> findDateByDoctitle(String key2);
双引号中有单引号,单引号还需要引号怎么办
加",或用转义符\例:
"<div><input id='publishTime' class='Wdate' type='text' onFocus='WdatePicker({dateFmt: "yyyy-MM-dd HH:mm:ss ",readOnly:true})' style='width: 160px' /></p></div>"
js根据方法名,调用方法,不是在同一个页面
var func = eval(requestMethodName);
new func(curr);
获取后台页面传递的参数,然后赋值给js变量
<%
String indexParamss = request.getAttribute("indexParam")+"";
%>
var indexParam = <%=indexParamss%>;
jsp页面用JAVA代码编写选择语句
<% if(("1").equals(com.dne.core.props.PropsUtil.get("literature.isToCdn"))){ %>
<input οnclick="window.parent.publishTwo();" class="bluebutton" id="publishFile" type="button" value="发布文件" style="margin-left:470px;"/>
<%} %>
jsp页面el表达式获取网站ip地址
${requestScope['javax.servlet.forward.request_uri']}
${requestScope['javax.servlet.forward.request_url']}