1. 程式人生 > >Tomcat下獲取web應用的絕對路徑

Tomcat下獲取web應用的絕對路徑

 可以獲取到"%tomcat_root%\%web_app_name%\"的絕對路徑

String webRoot = request.getSession().getServletContext().getRealPath("/");