<% String ipA = request.getHeader("Proxy-Client-IP"); String ipB = request.getRemoteAddr(); String ip = ""; if(ipA != null){ ip = ipA; } else{ ip = ipB; } %>