# 웹 서비스중 요청 클라이언트의 ip 확인 방법( webserver client ip search )
import javax.servlet.http.HttpServletRequest;
public final class CommonUtil {
public static String getIpAddress(HttpServletRequest request) {
String ip = null;
ip = request.getHeader("X-FORWARDED-FOR");
if (ip == null) {
ip = request.getHeader("Proxy-Client-IP");
if (ip == null) {
ip = request.getRemoteAddr();
}
}
return ip;
}
}
0 댓글