Class WebUtil

java.lang.Object
cn.sinozg.applet.common.utils.WebUtil

public class WebUtil extends Object
http 相关的
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static org.springframework.web.context.request.ServletRequestAttributes
    ServletRequestAttributes
    static <T> T
    Attribute的值
    static String
    getBodyString(jakarta.servlet.ServletRequest request)
    获取到请求里的 body
    static String
    getDomain(jakarta.servlet.http.HttpServletRequest request)
    请求URL
    static String
    请求URL
    static jakarta.servlet.http.HttpServletRequest
    获取 HttpServletRequest
    static jakarta.servlet.http.HttpServletResponse
    获取 HttpServletResponse
    static void
    设置值到Attribute

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      private static final org.slf4j.Logger log
  • Constructor Details

    • WebUtil

      private WebUtil()
  • Method Details

    • request

      public static jakarta.servlet.http.HttpServletRequest request()
      获取 HttpServletRequest
      Returns:
      HttpServletRequest
    • response

      public static jakarta.servlet.http.HttpServletResponse response()
      获取 HttpServletResponse
      Returns:
      HttpServletResponse
    • getAttribute

      public static <T> T getAttribute(String name)
      Attribute的值
      Type Parameters:
      T - Attribute类型
      Parameters:
      name - name
      Returns:
      Attribute的值
    • setAttribute

      public static void setAttribute(String name, Object o)
      设置值到Attribute
      Parameters:
      name - name
      o - 值
    • attributes

      private static org.springframework.web.context.request.ServletRequestAttributes attributes()
      ServletRequestAttributes
      Returns:
      ServletRequestAttributes
    • getBodyString

      public static String getBodyString(jakarta.servlet.ServletRequest request)
      获取到请求里的 body
      Parameters:
      request - 请求
      Returns:
      请求参数
    • getUrl

      public static String getUrl()
      请求URL
      Returns:
      URL
    • getDomain

      public static String getDomain(jakarta.servlet.http.HttpServletRequest request)
      请求URL
      Parameters:
      request - HttpServletRequest
      Returns:
      请求url