tomcat下webapp取得本地幾個路徑的代碼片斷

HttpServlet m_servlet = null; public void Init(HttpServlet servlet) { m_servlet = servlet; { String servlet_name = m_servlet.getServletName(); String servlet_info = m_servlet.getServletInfo(); String web_app_path = m_servlet.getServletContext().getRealPath("/"); String tomcat_home_path = System.getProperty("catalina.home"); String tomcat_base_path = System.getProperty("catalina.base"); logger.info("servlet_name is "+ servlet_name ); logger.info("servlet_info is "+ servlet_info ); logger.info("web_app_path is "+ web_app_path ); logger.info("tomcat_home_path is "+ tomcat_home_path ); logger.info("tomcat_base_path is "+ tomcat_base_path ); }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章