Properties 路径设置--servlet下的设置
//根据key读取valuepublic String readValue() { // 返回Servlet上下文路径。 String filePath = "/config/paper.properties"; String key = "pvalue"; String path = this.getServletContext().getRealPath("/"); path = path.substring(0, path.length() - 1); path = path + "/WEB-INF/classes"+filePath; System.out.println("path===============1"+path); Properties prop = new Properties(); try { FileInputStream input = new FileInputStream(path); prop.load(input); String value = prop.getProperty (key); return value; } catch (Exception e) { e.printStackTrace(); return "50"; }}