/**
* 获得项目工程的绝对路径
*/
public static String getWebRoot(HttpServletRequest request) {
return request.getSession().getServletContext().getRealPath("/");
}
/**
* 获得发布后的jar当前路径
*/
public String getJarRoot(){
ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource();
return jarFile.getParentFile().getPath();
}
springboot发布后(jar)获取路径
最新推荐文章于 2024-04-15 22:00:41 发布