Update 64.10. Configure Jetty.md

master
qibaoguang 2015-03-24 00:30:44 +08:00
parent 2eb36f6089
commit f5900e4a90
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
### 64.10. 禁止注册Servlet或Filter
正如[以上讨论](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-add-a-servlet-filter-or-servletcontextlistener)的任何Servlet或Filter beans将被自动注册到servlet容器中。为了禁止注册一个特殊的Filter或Servlet bean可以为它创建一个注册bean然后禁用该bean。例如
```java
@Bean
public FilterRegistrationBean registration(MyFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
return registration;
}
```