Как получить исходный домен с помощью HttpServletRequest?Исходный домен является доменом запрашивающей стороны.
Спасибо.
Вы можете сделать либо
// gets client (browser)'s hostname String host = request.getRemoteHost();
OR
// get the server's domain name. String domain = new URL(request.getRequestURL().toString()).getHost();
Запрос имени хоста
InetAddress ip = InetAddress.getLocalHost(); String hostname = ip.getHostName(); out.print("Your current IP address : " + ip+"\n"); out.print("Your current Hostname : " + hostname);