Fork me on GitHub
摘要: package com.dailywork.util; import java.io.UnsupportedEncodingException;import java.util.Properties; import javax.activation.DataHandler;import javax.... 阅读全文
posted @ 2015-07-08 00:38 扬州炒饭 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Properties properties = new Properties();// 方法1try { // 在加载的class文件中加载,文件是和类文件放在一下的 ClassLoader loader = PropertiesUtil.class.getClassLoader(); ... 阅读全文
posted @ 2015-07-08 00:37 扬州炒饭 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1:使用base64访问图片需求:浏览器中的标签动态更换来自服务器端的图片。适用场景:不能通过url直接获取到图片的时候。java后台service访问服务器端本地资源,生成二进制数据,转成base64编码:BASE64Encoder encoder = new sun.misc.BASE64Enc... 阅读全文
posted @ 2015-07-08 00:29 扬州炒饭 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 1 import java.awt.*; 2 import java.awt.image.BufferedImage; 3 import java.io.*; 4 import java.util.Random; 5 import javax.imageio.ImageIO; 6 7 publ... 阅读全文
posted @ 2015-07-08 00:23 扬州炒饭 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 在java web项目中虽然可以通过request.getParameterMap()很轻松的获得参数Map,但得到的Map和普通Map是不一样的,是被锁定的,不能像操作常规Map那样进行put、get等操作,该方法将得到参数Map返回为可操作的普通Map 1 /** 2 * 从request中获... 阅读全文
posted @ 2015-07-08 00:21 扬州炒饭 阅读(386) 评论(0) 推荐(0) 编辑
摘要: jsp中:1 (String)request.getSession().getAttribute("username"); // 获取2 request.getSession().setAttribute("username", "xxx"); // 设置Java中: 1 //servlet中 2... 阅读全文
posted @ 2015-07-08 00:18 扬州炒饭 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 统计求和:分组求和:sum(字段) over(patition by 字段)连续求和:sum(字段) over(order by 字段)分组排序编号:row_number(字段) over(partition by 字段, order by 字段)分组合计:group by ROLLUP(字段)递归... 阅读全文
posted @ 2015-07-08 00:13 扬州炒饭 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1:动态操作标签 1 //第一种类似jquery的操作,如果下面obj直接用selector比如"#id",得引用jquery,否则不需要。 2 var template = angular.element(html); 3 var element = $compile(template)($sco... 阅读全文
posted @ 2015-07-07 23:54 扬州炒饭 阅读(145) 评论(0) 推荐(0) 编辑