- 博客(17)
- 资源 (1)
- 收藏
- 关注
转载 java中给List排序接口
//这个是排序的方法List<ListProperty> pList = new ArrayList<>("ListProperty集合");Collections.sort(pList);//要用这个排序需要继承Comparable接口还要在List的实体对象中重写compareTo方法public int compareTo(Object o) { //先判断是不是他的实例
2016-08-29 18:23:22 1493
原创 java常用的快捷方法!
//截取扩展名之前的文件名filePath是字符串filePath.substring(0, filePath.lastIndexOf("."))
2016-08-20 17:30:54 308
原创 将带下滑线的英文字段转换为驼峰命名及替换字符!
替换字符 Pattern p = Pattern.compile("cat"); Matcher m = p.matcher("one cat two cats in the yard"); StringBuffer sb = new StringBuffer(); while (m.find()) { m.appendReplacement(sb, "dog"); } m.a
2016-08-19 09:52:30 2367
原创 jsp中${pagecontext.request.contextpath}作用!
${pageContext.request.contextPath}等价于<%=request.getContextPath()%> 或者可以说是<%=request.getContextPath()%>的EL版 意思就是取出部署的应用程序名或者是当前的项目名称比如我的项目名称是ajax01 在浏览器中输入为http://localhost:8080/ajax01/login.jsp ${pageC
2016-08-18 20:18:15 515
原创 备忘!!
获取文件源Thread.currentThread().getContextClassLoader() .getResource("").getFile();mongodb的删除GridFS文件if(isUseGridFS){ GridFS gridFiles = new GridFS(mongoTemplate.getDb()); gridFiles.remove(new
2016-08-18 19:00:30 184
原创 测试junit类的通用写法
1 .首先写测试公共类随意放,别的测试类直接继承它import org.junit.runner.RunWith;import org.springframework.test.context.ContextConfiguration;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;/** * 测试
2016-08-17 19:42:00 2106
原创 遍历对象中的所有属性,类型并显示值
引用的包为java.beans.Introspector 遍历对象属性,并获取其中的值Utils.covertValue(test, Map.class);为公共类//propertyDesc[i].getName()名字, propertyDesc[i].getPropertyType()类型public void getTest(){ //实例化一个类(其中有个class属性
2016-08-17 19:26:21 3969
原创 使用easyui的dialog两次加载数据问题!
function addBusinessData(){ $('#formDialog').dialog({ title: '编辑', width: '980px', height: '600px', closed: false, cache: false,
2016-08-16 17:05:42 4486
原创 js,easyui关闭当前的窗口!
function cancel(){ if (confirm("您确定要离开本页吗?")) { window.opener= null; window.open("","_self"); window.close(); if(window){ wind
2016-08-16 13:32:21 1174
原创 json自动转换成bean对象时Timestamp的问题!
在哪个字段的set方法中加入相关转化即可。public void setDate(String date){ System.out.println("时间转化问题"); if(null!=date&&StringUtils.isNotBlank(date)){ try { this.date = new Ti
2016-08-15 13:56:05 2603
原创 EasyUI的自定义验证!
小知识:换行<div class="clear"></div>隐藏<input hidden="true" type="text" name="id"/>easyui表单自动加载数据 $("表单ID").form('load', "请求地址/json字符串");获取url的最后位数var url = window.location.search;var searchId= ur
2016-08-12 19:49:32 468
原创 freemarker使用技巧
1.jar包把下载到的jar包(freemarker-2.3.9.jar可以随意版本)放到\WebRoot\WEB-INF\lib目录下。下载地址:http://freemarker.sourceforge.net/freemarkerdownload.html (注:官方网站.org的经常打不开)如果使用的是Maven结构,可在pom.xml中引入以下坐标<dependency><groupI
2016-08-11 19:16:19 435
原创 将表单内容转化成json字符串,并通过ajax提交!
1.JQuery的自定义方法,直接写个js文件放到里边,用的时候引一下就可以。(function($) { $.fn.extend({ serializeObject : function() { var o = {}; var a = this.serializeArray(); $.each(a, f
2016-08-11 18:42:34 10360
原创 java使用 freemarker 模板生成word文件
public class 类的名字{ private Configuration configuration = null; public 类的构造方法() { configuration = new Configuration(); configuration.setDefaultEncoding("UTF-8"); } // 要填入
2016-08-05 18:48:00 445
原创 freemarker编写宏并include到使用页面后调用宏!
1.宏文件mymacros.ftl的内容引用名 后边可加多个别名:name required width value isshow maxlength tip title>2.新的文件通过引入宏文件,这个是与宏文件在同级目录下的文件mymacro是个别名。3.使用时通过mymacro.引用名 name="${control.name}" requir
2016-08-05 16:54:35 2455
为混淆easyui源码,版本较老
2017-01-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人