类 WebServletLocalConfig

java.lang.Object
com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.config.WebServletLocalConfig

public final class WebServletLocalConfig extends Object
The configuration center for Web Servlet adapter (ported to Spring Web adapter).
从以下版本开始:
1.8.8
  • 字段详细资料

    • BLOCK_PAGE_URL_CONF_KEY

      public static final String BLOCK_PAGE_URL_CONF_KEY
      另请参阅:
    • BLOCK_PAGE_HTTP_STATUS_CONF_KEY

      public static final String BLOCK_PAGE_HTTP_STATUS_CONF_KEY
      另请参阅:
    • BLOCK_PAGE_ALLOW_ORIGINS_CONF_KEY

      public static final String BLOCK_PAGE_ALLOW_ORIGINS_CONF_KEY
      另请参阅:
  • 方法详细资料

    • getBlockPage

      public static String getBlockPage()
      Get redirecting page when blocked by Sentinel.
      返回:
      the block page URL, maybe null if not configured.
    • setBlockPage

      public static void setBlockPage(String blockPage)
    • getBlockPageHttpStatus

      public static int getBlockPageHttpStatus()

      Get the HTTP status when using the default block page.

      You can set the status code with the -Dcsp.sentinel.web.servlet.block.status property. When the property is empty or invalid, Sentinel will use 429 (Too Many Requests) as the default status code.

      返回:
      the HTTP status of the default block page
    • setBlockPageHttpStatus

      public static void setBlockPageHttpStatus(int httpStatus)
      Set the HTTP status of the default block page.
      参数:
      httpStatus - the HTTP status of the default block page