程序包 com.ajaxjs.util

类 WebUtils

java.lang.Object
com.ajaxjs.util.WebUtils

public class WebUtils extends Object
Web 工具类
  • 构造器详细资料

    • WebUtils

      public WebUtils()
  • 方法详细资料

    • getLocalIp

      public static String getLocalIp()
      获取 IP
      返回:
      ip
    • getClientIp

      public static String getClientIp(javax.servlet.http.HttpServletRequest request)
      The ip from browser. 要外网访问才能获取到外网地址,如果你在局域网甚至本机上访问,获得的是内网或者本机的ip
      参数:
      request - The request object
      返回:
      The ip
    • getCookie

      public static String getCookie(javax.servlet.http.HttpServletRequest request, String cookieName)
      尝试从 Cookie 中提取指定名称的 value
      参数:
      request - The request object
      cookieName - The name of cookie
      返回:
      The value of the cookie