类 WebServletLocalConfig
java.lang.Object
com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.config.WebServletLocalConfig
The configuration center for Web Servlet adapter (ported to Spring Web adapter).
- 从以下版本开始:
- 1.8.8
-
字段概要
字段 -
方法概要
修饰符和类型方法说明static StringGet redirecting page when blocked by Sentinel.static intGet the HTTP status when using the default block page.static voidsetBlockPage(String blockPage) static voidsetBlockPageHttpStatus(int httpStatus) Set the HTTP status of the default block page.
-
字段详细资料
-
方法详细资料
-
getBlockPage
Get redirecting page when blocked by Sentinel.- 返回:
- the block page URL, maybe null if not configured.
-
setBlockPage
-
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.statusproperty. 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
-