title: Getting the URL of the current page in Grails
body: <p>In a Grails application I'd like to send a user from page A, then to a form on page B and then back to page A again.</p>
  
  <p>To keep track of which URL to return to I send a "returnPage" parameter to page B containing the URL of page to return to (page A).</p>
  
  <p>Currently I'm using request.getRequestURL() on page A to retrieve the page's URL. However, the URL I get from getRequestURL() does not correspond to the URL the end-user has in his/hers address bar:</p>
  
  <pre><code>request.getRequestURL() == "http://localhost:8080/something/WEB-INF/grails-app/views/layouts/main.gsp"
  URL in address bar == "http://localhost:8080/something/some/thing"
  </code></pre>
  
  <p>How do I obtain the "end-user" URL?</p>