request getRealPath 的替代方法

                 

获得要路径的几种方法

1,request.getRealPath("/");这个方法已不推荐用

2,在Servlet 里用this.getServletContect().getRealPath("/");获得要路径。

3,struts里用this.getServlet().getServletContext().getRealPath("/")获得要路径。

           

猜你喜欢

转载自blog.csdn.net/qq_44910624/article/details/89395232