title: How to get the full requested URL in Java
body: <p>I have a URL like </p>
  
  <pre><code>www.abc.com/;jsessionid=53AA662D24A89922031913A6E85A005B
  </code></pre>
  
  <p>(sorry i can't specify my actual site name here, so using <code>abc.com</code>)</p>
  
  <p>When the above url is hit, i want to strip <code>;jsessionid=53AA662D24A89922031913A6E85A005B</code> from the above url in the back-end (in my servlet) and redirect to the actual url (in this example  <code>http://www.abc.com/</code>).</p>
  
  <p>I have tried many ways in my servlet to know whether the requested URL has 'jsessionid' or not, but I can't find a method that returns the full requested URL on HTTP request object</p>
  
  <p>I have tried the following methods on the HTTP request object </p>
  
  <ul>
  <li><code>getRequestURI()</code></li>
  <li><code>getRequestURL()</code></li>
  <li><code>getContextPath()</code></li>
  <li><code>getPathInfo()</code></li>
  </ul>
  
  <p>but they are not returning the full requested url with the <code>jsessionid</code>.</p>
  
  <p>I have tried <code>getParameter()</code>, <code>getParameterNames()</code> but no help as the above url doesn't have <code>?</code> before <code>jsessionid</code>.</p>