File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes HttpUtils replacemant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "HttpUtils replacemant" Watch "HttpUtils replacemant" New topic
Author

HttpUtils replacemant

Ivan Turner
Ranch Hand

Joined: Feb 27, 2012
Posts: 37
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

Joined: Jul 23, 2008
Posts: 296

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

Joined: Jan 10, 2002
Posts: 60046
    
  65

Using a reference that old is not only useless, but harmful. Ditch it for a more modern reference.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ivan Turner
Ranch Hand

Joined: Feb 27, 2012
Posts: 37
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

Joined: Feb 27, 2012
Posts: 37
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

Good grief, they're teaching you 10-year-old technology?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpUtils replacemant
 
Similar Threads
what is deprecated?
deprecated API
AWT
Error
deprecated function