jQuery in Action, 3rd edition
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 Building Microservices this week in the Design 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

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

Ceenu Reddy

Joined: Nov 16, 2006
Posts: 9

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

Joined: Dec 11, 2004
Posts: 13410

The API can.


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.


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()
It's not a secret anymore!