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方法 里面获取到项目根目录
最新推荐文章于 2021-05-12 13:52:46 发布