Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create @ConditionalOnMissingServletFilter #7475

Closed
bclozel opened this issue Nov 24, 2016 · 1 comment
Closed

Create @ConditionalOnMissingServletFilter #7475

bclozel opened this issue Nov 24, 2016 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Nov 24, 2016

This Conditional annotation should:

  • look for a bean of a particular type
  • if it doesn't find one, look for a FilterRegistrationBean that will register a Filter of a particular type

This condition should improve the auto-configuration of Servlet Filters.

We could go for a shorter name @ConditionalOnMissingFilter, but this could clash with a future similar annotation for Spring Web Reactive WebFilters.

@bclozel bclozel added the type: enhancement A general enhancement label Nov 24, 2016
@bclozel bclozel self-assigned this Nov 24, 2016
@bclozel bclozel added this to the 1.5.0 RC1 milestone Nov 24, 2016
bclozel added a commit to bclozel/spring-boot that referenced this issue Dec 15, 2016
This commit introduces a new Conditional annotation
`@ConditionalOnMissingServletFilter` which checks for the absence of
Servlet filters as beans or `FilterRegistrationBean`s.

This Conditional annotation can be used to guard Servlet Filter bean
definitions like:

```
@bean
@ConditionalOnMissingServletFilter
public MyServletFilter myServletFilter() {
  //...
}
```

Fixes spring-projectsgh-7475
bclozel added a commit to bclozel/spring-boot that referenced this issue Dec 15, 2016
This commit introduces a new Conditional annotation
`@ConditionalOnMissingServletFilter` which checks for the absence of
Servlet filters as beans or `FilterRegistrationBean`s.

This Conditional annotation can be used to guard Servlet Filter bean
definitions like:

```
@bean
@ConditionalOnMissingServletFilter(MyServletFilter.class)
public MyServletFilter myServletFilter() {
  //...
}
```

Fixes spring-projectsgh-7475
@bclozel bclozel modified the milestones: 2.0.0.M1, 1.5.0 M1 Dec 16, 2016
@philwebb philwebb modified the milestones: 2.0.0.M1, 2.0.0 Jan 12, 2017
@philwebb philwebb removed this from the 2.0.0 milestone Nov 8, 2017
@bclozel bclozel added this to the General Backlog milestone Oct 19, 2018
@philwebb philwebb assigned philwebb and unassigned bclozel Oct 24, 2018
@philwebb philwebb modified the milestones: General Backlog, 2.1.0 Oct 24, 2018
@philwebb
Copy link
Member

Fixed in 44a46f1 but accidentally referenced the wrong issue number.

@philwebb philwebb changed the title Create @ConditionalOnMissingServletFilter Create @ConditionalOnMissingServletFilter Oct 24, 2018
@bclozel bclozel closed this as completed Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants