
ZNJK
w星星b
这个作者很懒,什么都没留下…
展开
-
java.net.URLEncoder
java.net.URLEncoder.encode("需要被编码的字符串",目标编码); eg: String strUTF8=java.net.URLEncoder.encode("测试",UTF-8);====>将“测试”编码成UTF-8的字符串!原创 2013-10-18 09:42:46 · 692 阅读 · 0 评论 -
UtilDate(四)获取前月1号日期
SimpleDateFormat sdf = new SimpleDateFormat(pattern); Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.MONTH, -1); cal.set(Calendar.DAY_原创 2013-11-09 11:49:09 · 761 阅读 · 0 评论 -
UtilDate(三)获取前7天日期
// 定义输出日期格式 SimpleDateFormat sdf = new SimpleDateFormat(pattern); Date mdate = new Date(); int b = 7; Date fdate; Long fTime = mdate.getTime() - b * 24 * 3600000; fdate = new原创 2013-11-09 11:48:15 · 1243 阅读 · 0 评论 -
UtilDate(二)获取时间字符串
//获取所有字符串:20131109113501SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sp.format(new Date()); String time1 = time.replace("-", ""); String time2 = time1.replac原创 2013-11-09 11:43:03 · 585 阅读 · 0 评论 -
UtilDate(一):获取当前日期的年月日时分秒星期
Date date=new Date();//long now = System.currentTimeMillis(); // 取得当前时间 距离 00:00:00 UTC on January 1, 1970.的秒数 Calendar c = Calendar.getInstance();//获取一个Calendar实例 c.setTimeInMillis(date.getTime(原创 2013-11-09 11:32:21 · 1500 阅读 · 0 评论 -
图片下载
// 图片下载函数 public static String makeImg(String imgUrl, String fileURL) { String imgFile=""; try { // 创建流 BufferedInputStream in = new BufferedInputStream(new URL(imgUrl) .openStream());转载 2013-11-19 13:52:25 · 902 阅读 · 0 评论 -
<s:select ></s:select>使用
jsp: 取值与赋值: 在action中,对name属性提供一个ledSbbh的字段,getter/setter方法,和listLed的list,同样getter/setter方法就可以了private String ledSbbh; public String getLedSbbh() { return ledSbbh; } public void setLe原创 2013-10-31 14:12:05 · 784 阅读 · 0 评论 -
Spring定时器任务
http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/s原创 2013-10-18 09:57:59 · 700 阅读 · 0 评论 -
图片下载和压缩并转码成UTF-8的Base64流
public String getPic2(String imageUrl, String fileNamePath) { Image img = null; URL url; // url请求图片流 DataInputStream dis = null; // 文件写入流 InputStream in = null; byte[] data = nu原创 2013-10-18 09:45:59 · 3508 阅读 · 0 评论 -
java类路径使用
java.net.URL url=this.getClass() .getClassLoader().getResource("");//得到类路径 String [] strArr=url.getFile().split("/"); String [] strArr2=url.getFile().split(":"); String fileNamePath= strArr[1翻译 2013-10-18 11:51:36 · 513 阅读 · 0 评论 -
在ibatis动态sql中的< 、> 、<>等比较符号的处理
在在ibatis动态sql中, 、括起来。比如: and z.jgsj = ]]> to_date(#startTime#,'yyyy-MM-dd hh24:mi:ss')原创 2013-11-13 13:10:16 · 1138 阅读 · 0 评论