Ответ 1
Вы можете сделать либо
// gets client (browser) hostname
String host = request.getRemoteHost();
ИЛИ
// get the server domain name.
String domain = new URL(request.getRequestURL().toString()).getHost();
Как вы получаете исходный домен, используя HttpServletRequest? Исходным доменом является домен реквестера.
Спасибо.
Вы можете сделать либо
// gets client (browser) hostname
String host = request.getRemoteHost();
ИЛИ
// get the server 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);