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

public class InitServlet extends HttpServlet{

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

 

posted @ 2014-06-20 19:48  嗨,你的益达~~~  阅读(1367)  评论(0编辑  收藏  举报