title: How can I read the WebSEAL server address from request?
body: <p>I have a java enterprise application running on a websphere server. The application is only accessible through different webseal servers that do load balancing and authentication from different zones of the intranet.</p>
  
  <ul>
  <li>Intranet-URL: <code>https://webseal.intra/junction-old/ApplicationROOT</code></li>
  <li>VPN-URL: <code>https://webseal.vpn/junction-old/ApplicationROOT</code></li>
  </ul>
  
  <p>Of course I can access the application directly as well: <code>https://server-old.intra/ApplicationROOT</code>.</p>
  
  <p>The upcoming version of the application will be hosted at a new server. The application then is accessible through new junctions at the same webseal servers:</p>
  
  <ul>
  <li>Intranet-URL: <code>https://webseal.intra/junction-new/ApplicationROOT</code></li>
  <li>VPN-URL: <code>https://webseal.vpn/junction-new/ApplicationROOT</code></li>
  </ul>
  
  <p>Of course there will be a new direct url as well: <code>https://server-new.intra/ApplicationROOT</code></p>
  
  <p>I now want to add an information page to the old application that provide new urls to the users. This page should re-direct to the new version. Since we have different webseals I will not hardcode one url in the re-direction. But when I try to read the request url with <code>HttpServletRequest#getRequestURL()</code> I only get the direct server address.</p>
  
  <p>Is it possible to get the webseal address instead of the server address?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I have some kind of solution, but I do not like it very much. It is more like a workaround. Currently I am using javascript to read the webeal's url and then perform a re-direct:</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
          function redircetToNewUrl() {
  
              var port = window.location.port;
              if (port.length &gt; 0) {
                  port = ':' + port;
              } else {
                  port = '';
              }
  
              var url = 'https://' + window.location.hostname + port + '/junction-new/ApplicationROOT';
              setTimeout(function f() {location.href = url;}, 30000);
          }
      &lt;/script&gt;
      &lt;BODY onload="redircetToNewUrl()"&gt;
  </code></pre>
  
  <p>It works fine, but, as I said, I don't like it very much.It would be better to create the re-direct url using java in the jsp.</p>