request.getRealPath("") 这个方法已经不推荐使用了,那代替它的是什么方法呢? 下面就是替代它的方法: request.getSession().getServletContext().getRealPath() 得到站点的绝对地址 在servlet或者struts中还可以这样: this.getServletContext().getRealPath("/"); this.getServlet().getServletContext().getRealPath("/"); |
|