Path using the current web application root path and then stitching the required documents can be obtained an absolute path to a file
. 1 the ServletContext context = the this .getServletContext (); 2 String The realpath = context.getRealPath ( "desired file path");
Using the class loader path of the file acquired .class
. 1 the Properties P = new new the Properties (); 2 // Get the byte code list . 3 . String path = JdbcUtil class .getClassLoader () the getResource ( "the db.properties") getPath ()..;