标签:
文件位置:
代码:
public static Properties getProperties(){ Properties pts = new Properties (); FileInputStream in = null; try{ String path = UtilManager.class.getResource("/").getPath(); String websiteURL = (path.replace("/build/classes", "").replace("%20"," ").replace("classes/", "") + "wsdl.properties").replaceFirst("/", ""); System.out.println ("websiteURL:"+websiteURL); in = new FileInputStream(websiteURL); pts.load(in); }catch (FileNotFoundException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); } return pts; }
Java读取WEB-INF目录下的properties配置文件
标签:
原文地址:http://www.cnblogs.com/staryy/p/4724480.html