Search in sources :

Example 1 with ConditionalOnEnabledResourceChain

use of org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain in project spring-boot by spring-projects.

the class FreeMarkerServletWebConfiguration method resourceUrlEncodingFilter.

@Bean
@ConditionalOnEnabledResourceChain
@ConditionalOnMissingFilterBean(ResourceUrlEncodingFilter.class)
FilterRegistrationBean<ResourceUrlEncodingFilter> resourceUrlEncodingFilter() {
    FilterRegistrationBean<ResourceUrlEncodingFilter> registration = new FilterRegistrationBean<>(new ResourceUrlEncodingFilter());
    registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ERROR);
    return registration;
}
Also used : ResourceUrlEncodingFilter(org.springframework.web.servlet.resource.ResourceUrlEncodingFilter) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnEnabledResourceChain(org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain) ConditionalOnMissingFilterBean(org.springframework.boot.autoconfigure.web.servlet.ConditionalOnMissingFilterBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnMissingFilterBean(org.springframework.boot.autoconfigure.web.servlet.ConditionalOnMissingFilterBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 ConditionalOnEnabledResourceChain (org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain)1 ConditionalOnMissingFilterBean (org.springframework.boot.autoconfigure.web.servlet.ConditionalOnMissingFilterBean)1 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1 ResourceUrlEncodingFilter (org.springframework.web.servlet.resource.ResourceUrlEncodingFilter)1