Reputation: 590
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.
https://webseal.intra/junction-old/ApplicationROOT
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:
https://webseal.intra/junction-new/ApplicationROOT
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.
Upvotes: 1
Views: 560