I would like to add more information to help us find the solution.
We have means to check which server the app is on.
We have a file up on each server (ServerType.txt) which will contain DEV or TEST or PROD values depending on where that file itself is.
We are already doing something like this to get the host name in other situation.
protected
String getHostURL(HttpServletRequest request)
{
HttpSession session = request.getSession();
String hostURL="";
String deploymentType = HinProperties.getHinProperties().getStage();
if (deploymentType.equals("") || deploymentType.equals("DEV"))
{
hostURL="https://devserver.mycomany.state.xx.us/";
}
if (deploymentType.equals("TEST"))
{
hostURL="https://testserver.mycomany.state.xx.us/";
}
if (deploymentType.equals("PROD"))
{
hostURL="https://prodserver.mycomany.state.xx.us/";
}
session.setAttribute("hostURL",hostURL);
return hostURL;
}