public final class WebServletConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BLOCK_PAGE_HTTP_STATUS_CONF_KEY |
static String |
BLOCK_PAGE_URL_CONF_KEY |
static String |
WEB_SERVLET_CONTEXT_NAME |
| Modifier and Type | Method and Description |
|---|---|
static String |
getBlockPage()
Get redirecting page when Sentinel blocking for
CommonFilter or
CommonTotalFilter occurs. |
static int |
getBlockPageHttpStatus()
Get the HTTP status when using the default block page.
|
static void |
setBlockPage(String blockPage) |
static void |
setBlockPageHttpStatus(int httpStatus)
Set the HTTP status of the default block page.
|
public static final String WEB_SERVLET_CONTEXT_NAME
public static final String BLOCK_PAGE_URL_CONF_KEY
public static final String BLOCK_PAGE_HTTP_STATUS_CONF_KEY
public static String getBlockPage()
CommonFilter or
CommonTotalFilter occurs.public static void setBlockPage(String blockPage)
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.
public static void setBlockPageHttpStatus(int httpStatus)
httpStatus - the HTTP status of the default block pageCopyright © 2023 Alibaba Group. All rights reserved.