NetUtil { public static String getIpAddr() { HttpServletRequest request = getRequest(); String ipAddress = request.getHeader("x-forwarded-for"); if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("WL-Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getRemoteAddr(); if (ipAddress != null && ipAddress.length() > 15) { if (ipAddress.indexOf(",") > 0) { ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); } } } return ipAddress; }  static String getIpAddr(); static String getCookieValue(String name); static String getCurSessionId(); static String getPrimaryDomain(); static String getAccessUrl(); static String getUserAgent(); static HttpServletRequest getRequest(); final static String SESSION_ID; static final String USER_AGENT; }
@Test public void getIpAddr() throws Exception { }