如何在servlet刚启动时候获取服务器根目录?

时间:2014-06-22 23:49:27   收藏:0   阅读:203
public class InitServlet extends HttpServlet{

     public static String root;
    @Override
    public void init() throws ServletException {
         
        root = getServletContext().getRealPath("/");
     
    }

 

如何在servlet刚启动时候获取服务器根目录?,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!