• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpUtils replacemant

 
Ivan Turner
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking at Xue Bai's "JavaServer Pages" copyrighted 2003. It's examples use deprecated code. The author put this in some code example and it's deprecated too. Does anyone know what replaces this class/method?



It reconstructs the URL the client used to make the request. It return's the request's URL
 
jatan bhavsar
Ranch Hand
Posts: 297
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

HttpServletRequest has method getrequesturl please visit the http://docs.oracle.com/javaee/1.3/api/javax/servlet/http/HttpServletRequest.html

Regards
jatan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a reference that old is not only useless, but harmful. Ditch it for a more modern reference.
 
Ivan Turner
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jatan bhavsar wrote:Hi,

HttpServletRequest has method getrequesturl please visit the http://docs.oracle.com/javaee/1.3/api/javax/servlet/http/HttpServletRequest.html

Regards
jatan


Thanks jatan for pointing me in the right direction. I'll try to rewrite the code to use HttpServletRequest. It may be old but it works!!! I can't help it that the book the class is reading is old.
 
Ivan Turner
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java class is a data type containing data members and methods. The classes automatically imported into jsp are java.lang.*, javax.servlet.*, javax.servlet.jsp.*, javax.servlet.http.*. I was able to simply put <%= request.getRequestURL() %> in the code and do the same thing that HttpUtils was doing. request is an implicit object made available by the JSP container. Thanks again.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good grief, they're teaching you 10-year-old technology?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic