Class WebUtils

java.lang.Object
org.springframework.web.util.WebUtils
cn.herodotus.engine.oauth2.core.utils.WebUtils

public class WebUtils extends org.springframework.web.util.WebUtils

Description: Http与Servlet工具类.

Author:
: gengwei.zheng
Date:
: 2020/3/4 11:39
  • Field Summary

    Fields inherited from class org.springframework.web.util.WebUtils

    CONTENT_TYPE_CHARSET_PREFIX, DEFAULT_CHARACTER_ENCODING, DEFAULT_WEB_APP_ROOT_KEY, ERROR_EXCEPTION_ATTRIBUTE, ERROR_EXCEPTION_TYPE_ATTRIBUTE, ERROR_MESSAGE_ATTRIBUTE, ERROR_REQUEST_URI_ATTRIBUTE, ERROR_SERVLET_NAME_ATTRIBUTE, ERROR_STATUS_CODE_ATTRIBUTE, FORWARD_CONTEXT_PATH_ATTRIBUTE, FORWARD_PATH_INFO_ATTRIBUTE, FORWARD_QUERY_STRING_ATTRIBUTE, FORWARD_REQUEST_URI_ATTRIBUTE, FORWARD_SERVLET_PATH_ATTRIBUTE, HTML_ESCAPE_CONTEXT_PARAM, INCLUDE_CONTEXT_PATH_ATTRIBUTE, INCLUDE_PATH_INFO_ATTRIBUTE, INCLUDE_QUERY_STRING_ATTRIBUTE, INCLUDE_REQUEST_URI_ATTRIBUTE, INCLUDE_SERVLET_PATH_ATTRIBUTE, RESPONSE_ENCODED_HTML_ESCAPE_CONTEXT_PARAM, SESSION_MUTEX_ATTRIBUTE, SUBMIT_IMAGE_SUFFIXES, TEMP_DIR_CONTEXT_ATTRIBUTE, WEB_APP_ROOT_KEY_PARAM
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isRequestMatched(List<String> paths, jakarta.servlet.http.HttpServletRequest request)
    判断请求是否与设定的模式匹配
    static boolean
    isRequestMatched(org.springframework.security.web.util.matcher.RequestMatcher[] matchers, jakarta.servlet.http.HttpServletRequest request)
    判断请求是否与设定的模式匹配
    static void
    renderJson(jakarta.servlet.http.HttpServletResponse response, Object object)
    客户端返回JSON字符串
    static void
    renderJson(jakarta.servlet.http.HttpServletResponse response, String string, String type)
    客户端返回字符串
    static org.springframework.security.web.util.matcher.RequestMatcher[]
    将配置路径转换为 RequestMatcher 数组

    Methods inherited from class org.springframework.web.util.WebUtils

    clearErrorRequestAttributes, exposeErrorRequestAttributes, findParameterValue, findParameterValue, getCookie, getDefaultHtmlEscape, getNativeRequest, getNativeResponse, getParametersStartingWith, getRealPath, getRequiredSessionAttribute, getResponseEncodedHtmlEscape, getSessionAttribute, getSessionId, getSessionMutex, getTempDir, hasSubmitParameter, isIncludeRequest, isSameOrigin, isValidOrigin, parseMatrixVariables, removeWebAppRootSystemProperty, setSessionAttribute, setWebAppRootSystemProperty

    Methods inherited from class java.lang.Object

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

    • WebUtils

      public WebUtils()
  • Method Details

    • toRequestMatchers

      public static org.springframework.security.web.util.matcher.RequestMatcher[] toRequestMatchers(List<String> paths)
      将配置路径转换为 RequestMatcher 数组
      Parameters:
      paths - 静态请求路径
      Returns:
      RequestMatcher 数组
    • isRequestMatched

      public static boolean isRequestMatched(org.springframework.security.web.util.matcher.RequestMatcher[] matchers, jakarta.servlet.http.HttpServletRequest request)
      判断请求是否与设定的模式匹配
      Parameters:
      matchers - 路径匹配模式
      request - 请求
      Returns:
      是否匹配
    • isRequestMatched

      public static boolean isRequestMatched(List<String> paths, jakarta.servlet.http.HttpServletRequest request)
      判断请求是否与设定的模式匹配
      Parameters:
      paths - 路径
      request - 请求
      Returns:
      是否匹配
    • renderJson

      public static void renderJson(jakarta.servlet.http.HttpServletResponse response, Object object)
      客户端返回JSON字符串
      Parameters:
      response - HttpServletResponse
      object - 需要转换的对象
    • renderJson

      public static void renderJson(jakarta.servlet.http.HttpServletResponse response, String string, String type)
      客户端返回字符串
      Parameters:
      response - HttpServletResponse
      string - 需要绘制的信息