File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes javax.servlet.ServletRequest.getRealPath is Deprecated. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "javax.servlet.ServletRequest.getRealPath is Deprecated." Watch "javax.servlet.ServletRequest.getRealPath is Deprecated." New topic
Author

javax.servlet.ServletRequest.getRealPath is Deprecated.

naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 328


after reading online about the working of Tomcat , i am developing a servlet container for servlet 2.3 specification.

i have created a Request class implementing the javax.servlet.ServletRequest interface. this interface has method public java.lang.String getRealPath(java.lang.String path) which is Deprecated.
when i implements getRealPath(String ) i get warning that : java uses or overrides Deprecated api

what should i do to remove that warning ?
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18370

Read the suggestion from the method Javadoc comments.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Ankit Nagpal
Ranch Hand

Joined: Sep 09, 2008
Posts: 47

naveen yadav wrote:
after reading online about the working of Tomcat , i am developing a servlet container for servlet 2.3 specification.

i have created a Request class implementing the javax.servlet.ServletRequest interface. this interface has method public java.lang.String getRealPath(java.lang.String path) which is Deprecated.
when i implements getRealPath(String ) i get warning that : java uses or overrides Deprecated api

what should i do to remove that warning ?


use application.getRealPath(String) where application is a reference to Servlet Context and the parameter is the relative path of the file.
 
 
subject: javax.servlet.ServletRequest.getRealPath is Deprecated.
 
Threads others viewed
getRealPath Depricated?
deprecated interface methods
Last days of preparation
Replacement of deprecated servlet method
getRealPath Depricated?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com