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

setRegisterErrorPageFilter(false) not disable ErrorPageFilter #8477

Closed
mnhock opened this issue Mar 3, 2017 · 1 comment
Closed

setRegisterErrorPageFilter(false) not disable ErrorPageFilter #8477

mnhock opened this issue Mar 3, 2017 · 1 comment
Assignees
Labels
type: bug A general bug type: regression A regression from a previous release
Milestone

Comments

@mnhock
Copy link
Contributor

mnhock commented Mar 3, 2017

If I disable the ErrorPageFilter registration with this configuration, the ErrorPageFilter will be loaded nevertheless.

The configuration:

public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        setRegisterErrorPageFilter(false);
      ...
    }   
}

The Filter will be loaded through this code in SpringBootServletInitializer even the configuration above.

@Configuration
static class ErrorPageFilterConfiguration {
	@Bean
	public ErrorPageFilter errorPageFilter() {
		return new ErrorPageFilter();
	}
}

The only way for me to disable the filter is with this configuration:

@Bean
public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(filter);
        filterRegistrationBean.setEnabled(false);
        return filterRegistrationBean;
}

I think it should work without this explicit FilterRegistrationBean configuration.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 3, 2017
@mnhock mnhock changed the title setRegisterErrorPageFilter(false) will not disable ErrorPageFilter setRegisterErrorPageFilter(false) not disable ErrorPageFilter Mar 3, 2017
@wilkinsona
Copy link
Member

This problem was introduced in this commit.

@wilkinsona wilkinsona added priority: high type: bug A general bug type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 3, 2017
@wilkinsona wilkinsona added this to the 1.5.2 milestone Mar 3, 2017
@wilkinsona wilkinsona self-assigned this Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants