wood burning stoves*
The moose likes Servlets and the fly likes Difference b/w response.encodeURL() and response.encodeRedirectURL() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference b/w response.encodeURL() and response.encodeRedirectURL()" Watch "Difference b/w response.encodeURL() and response.encodeRedirectURL()" New topic
Author

Difference b/w response.encodeURL() and response.encodeRedirectURL()

Ceenu Reddy
Greenhorn

Joined: Nov 16, 2006
Posts: 9
Folks,

We use response.encodeURL() and response.encodeRedirectURL() methods are used for URL rewriting, if the cookies disabled in the browswer or not supported.

Can anybody explain what is the difference b/w above two methods exactly?


Thanks in advance...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The API can.

encodeRedirectURL

public java.lang.String encodeRedirectURL(java.lang.String url)

Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination can differ from those used to decide whether to encode a normal link, this method is separated from the encodeURL method.


http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference b/w response.encodeURL() and response.encodeRedirectURL()