类 ServletUtils

java.lang.Object
cn.hutool.extra.servlet.JakartaServletUtil
cn.daenx.yhchatsdk.common.utils.ServletUtils

public class ServletUtils extends cn.hutool.extra.servlet.JakartaServletUtil
客户端工具类
作者:
DaenMax
  • 构造器详细资料

    • ServletUtils

      public ServletUtils()
  • 方法详细资料

    • getParameter

      public static String getParameter(String name)
      获取String参数
    • getParameter

      public static String getParameter(String name, String defaultValue)
      获取String参数
    • getParameterToInt

      public static Integer getParameterToInt(String name)
      获取Integer参数
    • getParameterToInt

      public static Integer getParameterToInt(String name, Integer defaultValue)
      获取Integer参数
    • getParameterToBool

      public static Boolean getParameterToBool(String name)
      获取Boolean参数
    • getParameterToBool

      public static Boolean getParameterToBool(String name, Boolean defaultValue)
      获取Boolean参数
    • getParams

      public static Map<String,String[]> getParams(jakarta.servlet.ServletRequest request)
      获得所有请求参数
      参数:
      request - 请求对象ServletRequest
      返回:
      Map
    • getParamMap

      public static Map<String,String> getParamMap(jakarta.servlet.ServletRequest request)
      获得所有请求参数
      参数:
      request - 请求对象ServletRequest
      返回:
      Map
    • getRequest

      public static jakarta.servlet.http.HttpServletRequest getRequest()
      获取request
    • getResponse

      public static jakarta.servlet.http.HttpServletResponse getResponse()
      获取response
    • getSession

      public static jakarta.servlet.http.HttpSession getSession()
      获取session
    • getRequestAttributes

      public static org.springframework.web.context.request.ServletRequestAttributes getRequestAttributes()
    • renderString

      public static void renderString(jakarta.servlet.http.HttpServletResponse response, String string)
      将字符串渲染到客户端
      参数:
      response - 渲染对象
      string - 待渲染的字符串
    • isAjaxRequest

      public static boolean isAjaxRequest(jakarta.servlet.http.HttpServletRequest request)
      是否是Ajax异步请求
      参数:
      request -
    • getClientIP

      public static String getClientIP()
    • urlEncode

      public static String urlEncode(String str)
      内容编码
      参数:
      str - 内容
      返回:
      编码后的内容
    • urlDecode

      public static String urlDecode(String str)
      内容解码
      参数:
      str - 内容
      返回:
      解码后的内容