java或者web中解决所有的路径问题.
File f = new File(com/test.java); String path = this.getServletContext().getRealPath("/"); Properties p = new Properties(); p.load(new FileInputStream(new File(path.substring(0,(path.lastIndexOf("\\WebRoot") + 1)) + "doc/db.properties"))); System.out.println(p.getProperty("driverName")); http://tmsoft.lsxy.com/trackback.php?tbID=949&extra=5cc5d5