You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,24 @@
37
37
* {@link FilterRegistrationBean}.
38
38
* <p>
39
39
* When placed on a {@code @Bean} method, the bean class defaults to the return type of
40
-
* the factory method:
40
+
* the factory method or the type of the {@link Filter} if the bean is a
41
+
* {@link FilterRegistrationBean}:
42
+
*
43
+
* <pre class="code">
44
+
* @Configuration
45
+
* public class MyAutoConfiguration {
46
+
*
47
+
* @ConditionalOnMissingFilterBean
48
+
* @Bean
49
+
* public MyFilter myFilter() {
50
+
* ...
51
+
* }
52
+
*
53
+
* }</pre>
54
+
* <p>
55
+
* In the sample above the condition will match if no bean of type {@code MyFilter} or
56
+
* {@code FilterRegistrationBean<MyFilter>} is already contained in the
0 commit comments