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 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