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();
}
}
SSH中 Servlet init方法 里面获取到项目根目录
最新推荐文章于 2019-11-27 15:17:14 发布