title: Get current URL in Webapplication
body: <p>I am in process to capture Current URL as its being displayed in the browser's address bar in my JSP page and have few options to get it done.</p>
  
  <ul>
  <li>Using <code>javax.servlet.include.request_uri</code> and other defined in Servlet 2.4 specification.I refer this thread to get details about it <a href="https://stackoverflow.com/questions/1256562/java-httpservletrequest-get-url-in-browsers-url-bar">java-httpservletrequest-get-url-in-browsers-url-bar</a>.</li>
  </ul>
  
  <p>In my current application, we are going to put web-server in front of our application server as than it seems that those values will be of not any use.</p>
  
  <p>I have another way to take help of javascript's  <code>document.URL</code> but i am not sure how reliable it is going to be.</p>
  
  <p>I need to get the details about the location of the user and if I can use <code>getRequestURI()</code>, it will return me something like <code>www.abc.com/abc/search.jsp</code>.</p>
  
  <p>In short, all I want to capture the URL being there in the address bar of the browser and save it in a hidden field of my JSP page.</p>
  
  <p>I am not sure what is the best way to achieve this.</p>