10 2012 档案

摘要:经验:getRootPath1在tomcat和weblogic以war包发布有效getRootPath1在tomcat和weblogic以文件夹发布有效 public static String getRootPath1() { return System.getProperty("miugonavi.root"); } public static String getRootPath2() { String classPath = null; try { //toURI() 20% to 空格 classPath = CommonUtil.class.get... 阅读全文
posted @ 2012-10-23 19:25 七郎 编辑
摘要:关键字: json gson javaGson网址http://code.google.com/p/google-gson/1.简单的处理list和map?1234567891011121314Gson gson = new Gson(); List testList = new ArrayList(); testList.add("first"); testList.add("second"); String listToJson = gson.toJson(testList); System.out.println(listToJson); //pr 阅读全文
posted @ 2012-10-22 17:46 七郎 编辑
摘要:JSONObject与JSONArray的使用1.JAR包简介要使程序可以运行必须引入JSON-lib包,JSON-lib包同时依赖于以下的JAR包:commons-lang.jarcommons-beanutils.jarcommons-collections.jarcommons-logging.jarezmorph.jarjson-lib-2.2.2-jdk15.jar2.JSONObject对象使用JSON-lib包是一个beans,collections,maps,java arrays 和XML和JSON互相转换的包。在本例中,我们将使用JSONObject类创建JSONObjec 阅读全文
posted @ 2012-10-18 15:50 七郎 编辑
摘要:读取src下的属性文件的某个key值 /** * 读取src下某个属性文件中的某个key所对应的value * * @param args * */ public static void main(String[] args) { String key = "file.upload.folder"; String propertiesFileFullName = "myProperty.properties"; String pbundle = "myProperty"; fun1(propertiesFileFullName, ke 阅读全文
posted @ 2012-10-16 18:39 七郎 编辑

点击右上角即可分享
微信分享提示