获取当前项目下的Tomcat下的webapp路径

2018-08-20  本文已影响0人  Yancary

request.getSession().getServletContext().getRealPath("").replace("\"+request.getContextPath().replaceAll("/", ""), "");
思路:
1:获取项目路径
2:获取项目名称
3:替换项目路径中的项目名称

上一篇 下一篇

猜你喜欢

热点阅读