开发者

I want to get the real path of a file in java by using the request method getRealPath()but it is deprecated now i want an alternate to it

I want to ge开发者_StackOverflow中文版t the real path of a file in java by using the request method getRealPath()but it is deprecated now i want an alternate to it i tried get servletcontext but it is not returning the whole path

in jsp page when i m using application.getRealPath("/") it is giving whole path as D:/.....

but in java servlet code i m not getting this method working so i want a perfect httprequest method which will be returning whole path of the application.

please suggest me a perfect method with example if possible


request.getServletContext().getRealPath(..) (or if you are within a servlet, just call getServletContext().getRealPath(..)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜