I have created web application using JSF 2.0. I have hosted it on hosting site and the server of the hosting site is based in US.
My client want the details of the u
I went ahead with
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null) {
ipAddress = request.getRemoteAddr();
}
System.out.println("ipAddress:" + ipAddress);