获得当前运行文件在服务器上的绝对路径
1.request.getSession().getServletContext().getRealPath("/");
2.ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/");
原文:https://www.cnblogs.com/yy-hang/p/15245552.html