Sentinel/sentinel-adapter/sentinel-web-servlet
Eric Zhao b212e5f26e Bump version to 0.2.0-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-08-08 20:45:25 +08:00
..
src/main/java/com/alibaba/csp/sentinel/adapter/servlet Welcome to the world, Sentinel 2018-07-27 16:34:30 +08:00
README.md Welcome to the world, Sentinel 2018-07-27 16:34:30 +08:00
pom.xml Bump version to 0.2.0-SNAPSHOT 2018-08-08 20:45:25 +08:00

README.md

Sentinel Web Servlet Filter

Sentinel provides Servlet filter integration. To use the filter, you can simply configure your web.xml with:

<filter>
	<filter-name>SentinelCommonFilter</filter-name>
	<filter-class>com.alibaba.csp.sentinel.adapter.servlet.CommonFilter</filter-class>
</filter>

<filter-mapping>
	<filter-name>SentinelCommonFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

When a request is blocked, Sentinel servlet filter will give a default page indicating the request blocked. If customized block page is set (via WebServletConfig.setBlockPage(blockPage) method), the filter will redirect the request to provided URL. You can also implement your own block handler (the UrlBlockHandler interface) and register to WebCallbackManager.