title: Get domain name in url with JSTL?
body: <p>I am trying to get the domain name from the url with JSTL. The 2 methods I know return the wrong information. I need exactly what is in the URL. </p>
  
  <p>When I do:</p>
  
  <pre><code>${pageContext.request.remoteHost}
  </code></pre>
  
  <p>I get my server's IP.</p>
  
  <p>When I do:</p>
  
  <pre><code>${pageContext.request.serverName}
  </code></pre>
  
  <p>I normally get the right domain name, but on a server we have on amazon its returning "server1" instead of the correct domain name, probably because of the way it handles multiple domains.</p>
  
  <p>Anyone know how I can get the current domain name in the URL?</p>
  
  <p>I may need to get the URL and then parse it. How would I do that?</p>