|
自己已經(jīng)搞定,在servlet里面讀取這個文件的 String rootpath =getServletContext().getRealPath("/"); if (rootpath != null) { rootpath = rootpath.replaceAll("\\\\", "/"); } else { rootpath = "/"; } if (!rootpath.endsWith("/")) { rootpath = rootpath + "/"; } Properties prop = null; try { prop = new Properties(); prop.load(new FileInputStream(rootpath + "WEB-INF/init.properties")); } catch (IOException e) { e.printStackTrace(); } String phpurl= prop.getProperty("phpaddress"); |
|
|