title: Get request URL in JSP which is forwarded by Servlet
body: <p>How can I get request URL in JSP which is forwarded by Servlet?</p>
  
  <p>If I run following code in JSP,</p>
  
  <pre><code>System.out.println("servlet path= " + request.getServletPath());
  System.out.println("request URL= " + request.getRequestURL());
  System.out.println("request URI= " + request.getRequestURI());
  </code></pre>
  
  <p>then I get the server side path to the JSP. But I want to get the URL as you can see in browser's address bar. I can get it in the Servlet that forwards to the JSP, but I want to get it within the JSP.</p>