开发者

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

开发者 https://www.devze.com 2023-01-20 13:58 出处:网络
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

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

精彩评论

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