程序包 com.ajaxjs.util
类 WebUtils
java.lang.Object
com.ajaxjs.util.WebUtils
Web 工具类
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringgetClientIp(javax.servlet.http.HttpServletRequest request) The ip from browser.static String尝试从 Cookie 中提取指定名称的 valuestatic String获取 IP
-
构造器详细资料
-
WebUtils
public WebUtils()
-
-
方法详细资料
-
getLocalIp
获取 IP- 返回:
- ip
-
getClientIp
The ip from browser. 要外网访问才能获取到外网地址,如果你在局域网甚至本机上访问,获得的是内网或者本机的ip- 参数:
request- The request object- 返回:
- The ip
-
getCookie
尝试从 Cookie 中提取指定名称的 value- 参数:
request- The request objectcookieName- The name of cookie- 返回:
- The value of the cookie
-