1

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.

  • Intranet-URL: https://webseal.intra/junction-old/ApplicationROOT
  • VPN-URL: https://webseal.vpn/junction-old/ApplicationROOT

Of course I can access the application directly as well: https://server-old.intra/ApplicationROOT.

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:

  • Intranet-URL: https://webseal.intra/junction-new/ApplicationROOT
  • VPN-URL: https://webseal.vpn/junction-new/ApplicationROOT

Of course there will be a new direct url as well: https://server-new.intra/ApplicationROOT

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 HttpServletRequest#getRequestURL() I only get the direct server address.

Is it possible to get the webseal address instead of the server address?

Edit:

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:

<script type="text/javascript" >
        function redircetToNewUrl() {

            var port = window.location.port;
            if (port.length > 0) {
                port = ':' + port;
            } else {
                port = '';
            }

            var url = 'https://' + window.location.hostname + port + '/junction-new/ApplicationROOT';
            setTimeout(function f() {location.href = url;}, 30000);
        }
    </script>
    <BODY onload="redircetToNewUrl()">

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Joko
  • 600
  • 3
  • 15
  • 1
    The junctions can be configured to set request headers providing you with information. For example, my junctions pass iv-remote-address and iv_server_name headers containing the IP address and server name respectively of the webseal server that forwarded the request. There are likely more headers that webseal can send, but I do not have access to the webseal admin to confirm that or not. – Palamino Mar 28 '19 at 14:00
  • @Palamino ^ that could probably be an answer rather than just a comment. – dbreaux Mar 28 '19 at 14:23
  • How can I then read this fields? Is it HttpServletRequest#getSession().getAttribute()? – Joko Mar 28 '19 at 15:04
  • @Joko `getHeader()` – dbreaux Mar 29 '19 at 13:04

0 Answers0