passer1991

2013年8月5日

读取web应用中properties配置文件(这种方法可能不是最好的)

摘要: String path= ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/WEB-INF/spring/config.properties") ; Properties p=new Properties(); try { p.load(new FileInputStream(path)); System.out.println(p.getProperty("uploadPath")); } catch (Exception e) { e.p 阅读全文

posted @ 2013-08-05 19:56 passer1991 阅读(203) 评论(0) 推荐(0) 编辑

导航