• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.servlet.ServletRequest.getRealPath is Deprecated.

 
naveen yadav
Ranch Hand
Posts: 384
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the suggestion from the method Javadoc comments.
 
Ankit Nagpal
Ranch Hand
Posts: 47
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic