title: How to get the original request url from a servlet/jsp after multiple servlet forwards
body: <p>I am working on a cruise booking app using struts/tiles that uses <strong>multiple</strong> internal servlet/jsp forwards to reach the right jsp for display. But, once you reach the final jsp that is used to render the page, the <code>${pageContext.request.requestURL}</code> call in that jsp returns the path of <strong>this</strong> jsp.</p>
  
  <p>For example</p>
  
  <ol>
  <li>Original request:  <strong>/booking/getCruiseDetails</strong></li>
  <li>gets forwarded to: /booking/validateCruiseDeteails.jsp</li>
  <li>gets forwarded to: /booking/validateUser.jsp</li>
  <li>finally gets forwarded to: <strong>/booking/showCruiseDetails.jsp</strong></li>
  </ol>
  
  <p>So, in /booking/showCruiseDetails.jsp when I call <code>${pageContext.request.requestURL}</code> I
  get /booking/showCruiseDetails.jsp</p>
  
  <p>How do you get the the original (client made) request url from a jsp that has been reached through <strong>multiple</strong> forwards.  I did find the following posts on stackoverflow that hint at the solution <a href="https://stackoverflow.com/questions/2989888/get-request-url-from-jsp">here</a> and <a href="https://stackoverflow.com/questions/2089528/how-to-get-the-url-of-the-client">here</a>, but they don't address how you would go about finding the original request url after multiple forwards have occurred.</p>