title: Difference between encodeURL and encodeRedirectURL
body: <p>The <a href="http://download.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html" rel="noreferrer">javadoc</a> for <code>javax.servlet.http.HttpServletResponse</code> is a little vague on the difference between what rules <code>encodeURL</code> and <code>encodeRedirectURL</code> follow, are there any examples of what those exact rules are? When will the output of <code>encodeURL</code> differ from <code>encodeRedirectURL</code>?</p>
  
  <p>For a concrete example, I am already generating a redirect url that I will use with <code>response.sendRedirect(url)</code>. I get that url already encoded, but I want to add a parameter to it which has a value that is another url:</p>
  
  <pre><code>param2=http://google.com
  </code></pre>
  
  <p>Which of the two functions do I use to encode this?</p>