Я создал веб-приложение с использованием JSF 2.0. Я разместил его на сайте хостинга, а сервер хостинг-сайта базируется в США.
Мой клиент хочет получить информацию о пользователе, который получил доступ к сайту. Как найти IP-адрес пользователя в JSF?
Я пробовал с помощью
try {
InetAddress thisIp = InetAddress.getLocalHost();
System.out.println("My IP is " + thisIp.getLocalHost().getHostAddress());
} catch (Exception e) {
System.out.println("exception in up addresss");
}
однако это дает мне ip-адрес моего сайта только i.e. ip-адрес сервера.
Может ли кто-нибудь сказать мне, как получить IP-адрес, который обратился к веб-сайту с помощью Java?