diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java index 81c8334f8d..f48265e98f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java @@ -33,11 +33,28 @@ import org.springframework.core.annotation.AliasFor; /** * {@link Conditional} that only matches when no {@link Filter} beans of the specified * type are contained in the {@link BeanFactory}. This condition will detect both directly - * register {@link Filter} beans as well as those registered via a + * registered {@link Filter} beans as well as those registered via a * {@link FilterRegistrationBean}. *
* When placed on a {@code @Bean} method, the bean class defaults to the return type of - * the factory method: + * the factory method or the type of the {@link Filter} if the bean is a + * {@link FilterRegistrationBean}: + * + *
+ * @Configuration
+ * public class MyAutoConfiguration {
+ *
+ * @ConditionalOnMissingFilterBean
+ * @Bean
+ * public MyFilter myFilter() {
+ * ...
+ * }
+ *
+ * }
+ *
+ * In the sample above the condition will match if no bean of type {@code MyFilter} or
+ * {@code FilterRegistrationBean