文章分类 - Java
摘要:第一步:项目WEB-INF\web.xml 文件中添加: encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 ...
阅读全文
摘要:ParseXML.java工具类:package cn.xxxx.util;import java.io.File;import org.dom4j.Document;import org.dom4j.DocumentException;import org.dom4j.Element;import...
阅读全文
摘要:java获取类文件路径// 得到的是当前类FileTest.class文件的URI目录。不包括自己!// (1).Aa.class.getResource("")System.out.println(Aa.class.getResource(""));// 得到的是当前的class...
阅读全文
摘要:SimplePropertyPreFilter filter = new SimplePropertyPreFilter(实体类.class, "字段名","字段名");JSON.toJSONString(list, filter);
阅读全文
摘要:My JSP 'fmt.jsp' starting page currency: percent: full--> long--> medium--> default--> short--> 今天是:现在是:结果:今天是:公元 2007年10月19日 星期五现在是:下午 20:04:11.484 CSTThe input parameters must match the patterns, or the JSP will thrown an exception. This page does no error handling.Input par
阅读全文
摘要:在使用类似这样:Java代码 this.getClass().getClassLoader().getResource("").getPath() 来获取文件路径时,里面的路径空格会被“%20”代替,这时候如果你用这个获取到的包含“%20”的路径来new一个File时,会出现找不到路径的错误。在网上找了一下(链接:http://www.cumt.org/blog/493),说是“Java 的一个历史悠久的 bug”。于是有以下官方解决方法:Java代码 URI uri = new URI(url.toString()); FileInputStream fis = new
阅读全文

浙公网安备 33010602011771号