1 ServletContext context = request.getServletContext(); 2 String path = context.getRealPath("/WEB-INF/classes/jdbc.properties"); 3 System.out.println("path"+path); 4 Properties pro = new Properties(); 5 pro.load(new FileReader(path)); 6 System.out.println("jdbc.url:"+pro.get("jdbc.url"));