SSH中 Servlet init方法 里面获取到项目根目录
程序员文章站
2022-04-23 17:51:18
...
public void init(ServletConfig config) throws ServletException { super.init(config); try { String basePath = org.springframework.web.util.WebUtils.getRealPath( this.getServletContext(), "/"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
上一篇: 即便留住你的人也留不住你的心
下一篇: 原来我们只是红尘世间的过客