随笔分类 -  Java小笔记

摘要:就是有个模板,完全保留模板样式的情况下,在相应的地方更改或保留数据 第一个类: fileInputStream.close(); out.close(); bos.close(); 里面调用的另一个类 public static void WriteWordByMB(String pathIn, S 阅读全文
posted @ 2018-04-08 15:34 Ice_Blue_Brother 阅读(767) 评论(0) 推荐(0)
摘要:就是有个模板,完全保留模板样式的情况下,在相应的地方更改或保留数据 //参数按顺序分别是模板路径,生成后的文件保存到的路径,替换的内容(键为“行-列”),第几个sheet 阅读全文
posted @ 2018-04-08 15:23 Ice_Blue_Brother 阅读(440) 评论(0) 推荐(0)
摘要:JSON.toJSONString("/*这里放要转Json的东西,随便什么,map,实体,list,其他,都行*/") 阅读全文
posted @ 2018-02-06 17:06 Ice_Blue_Brother 阅读(203) 评论(0) 推荐(0)
摘要:比如有两个实体,字段灰常多,然后我们需要将其中一个实体的值赋给另一个实体,如果一个个的set的想想就很累。 如果两个实体是同一个类,直接不需要说,不是同一个类,但同名字段很多也可以用(其实都可以用,主要他只会将同名字段的值从一个赋给另一个,同名不多用起来意义不大),不同名的字段不做处理 import 阅读全文
posted @ 2018-02-06 17:06 Ice_Blue_Brother 阅读(1487) 评论(0) 推荐(0)
摘要:传中文request和response好爱乱码,但URLEcoending又不能改(看情况,改了会没法识别路径,文件名之类的) 那就转码吧…… 返回的话加这个 这个也可以转 阅读全文
posted @ 2018-02-06 17:05 Ice_Blue_Brother 阅读(622) 评论(0) 推荐(0)
摘要:Date的话如下 int minutes = (int) ((date2.getTime() - date.getTime())/(1000 * 60)); 其他单位改改算法就行了 如果是时间戳的话,直接减就行了…… 阅读全文
posted @ 2018-02-06 17:02 Ice_Blue_Brother 阅读(246) 评论(0) 推荐(0)
摘要:监听类 xml里面的配置 阅读全文
posted @ 2018-02-06 16:46 Ice_Blue_Brother 阅读(351) 评论(0) 推荐(0)
摘要:过滤器类 xml文件中的配置 阅读全文
posted @ 2018-02-06 16:44 Ice_Blue_Brother 阅读(245) 评论(0) 推荐(0)
摘要:import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; //co 阅读全文
posted @ 2018-02-06 16:41 Ice_Blue_Brother 阅读(293) 评论(0) 推荐(0)
摘要:看情况有时候某些属性值在很多地方要用,而且可能会有改动,就可以把它们存在properties文件中。 当然也可以准备一个静态类来放。 //调用方法的静态代码块 private static String getStr = ""; static { try { Properties propertie 阅读全文
posted @ 2018-02-06 16:39 Ice_Blue_Brother 阅读(378) 评论(0) 推荐(0)
摘要:SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //造型随你喜欢 Long time=null; //timestamp为需要转换的时间戳 time=new Long(String.valueOf(time 阅读全文
posted @ 2018-02-06 16:37 Ice_Blue_Brother 阅读(271) 评论(0) 推荐(0)
摘要:如果文件下面有东西的话,要一层层的删 阅读全文
posted @ 2018-02-06 16:31 Ice_Blue_Brother 阅读(429) 评论(0) 推荐(0)
摘要://BeanUtil里面的方法 阅读全文
posted @ 2018-02-06 16:11 Ice_Blue_Brother 阅读(918) 评论(0) 推荐(0)
摘要:算了,不废话了 阅读全文
posted @ 2018-02-06 12:41 Ice_Blue_Brother 阅读(281) 评论(0) 推荐(0)
摘要:看情况会有用,虽然我觉得转Json更快…… 阅读全文
posted @ 2018-02-06 12:39 Ice_Blue_Brother 阅读(1653) 评论(0) 推荐(0)
摘要:如果json是数组,则转成list 根据需要还可以将map转换为list 转键也可以 阅读全文
posted @ 2018-02-06 12:36 Ice_Blue_Brother 阅读(474) 评论(0) 推荐(0)
摘要:public class RandStrUtil { public final static String EN_UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public final static String EN_LOWER = "abcdefghijklmnop 阅读全文
posted @ 2018-02-06 12:35 Ice_Blue_Brother 阅读(253) 评论(0) 推荐(0)