1 :获取1: getPath ()相对路径
Stringpath=clazz.getResource (' ' ).getPath );
返回新文件(path ).getAbsolutePath );
2: getRootClassPath () )。
string path=path kit.class.getclass loader (.get resource ) ' '.toURI ).getPath );
返回新文件(path ).getAbsolutePath );
3.getWebRootPath
string path=class.class.get resource ('/' ).toURI ).getPath );
returnnewfile(path ).get parent file (.get parent file ) ).getCanonicalPath );
e :workspacej final _ demo _ for _ JSPwebroot美丽的手机classescomjfinalkit
e :workspacej final _ demo _ for _ JSPwebroot美丽的手机classes
e :workspacej final _ demo _ for _ JSPwebroot