Search in sources :

Example 21 with FilterRegistrationBean

use of org.springframework.boot.web.servlet.FilterRegistrationBean in project libresonic by Libresonic.

the class Application method bootstrapVerificationFilterRegistration.

@Bean
public FilterRegistrationBean bootstrapVerificationFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(bootstrapVerificationFiler());
    registration.addUrlPatterns("/*");
    registration.setName("BootstrapVerificationFilter");
    registration.setOrder(1);
    return registration;
}
Also used : FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 22 with FilterRegistrationBean

use of org.springframework.boot.web.servlet.FilterRegistrationBean in project libresonic by Libresonic.

the class Application method cacheFilterRegistration.

@Bean
public FilterRegistrationBean cacheFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(cacheFilter());
    registration.addUrlPatterns("/icons/*", "/style/*", "/script/*", "/dwr/*", "/icons/*", "/coverArt.view", "/avatar.view");
    registration.addInitParameter("Cache-Control", "max-age=36000");
    registration.setName("CacheFilter");
    registration.setOrder(5);
    return registration;
}
Also used : FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 23 with FilterRegistrationBean

use of org.springframework.boot.web.servlet.FilterRegistrationBean in project goci by EBISPOT.

the class SearchConfiguration method disableSpringBootErrorFilter.

@Bean
public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {
    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
    filterRegistrationBean.setFilter(filter);
    filterRegistrationBean.setEnabled(false);
    return filterRegistrationBean;
}
Also used : FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)23 Bean (org.springframework.context.annotation.Bean)21 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)10 HashMap (java.util.HashMap)4 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)4 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)3 Filter (javax.servlet.Filter)2 HttpWebRequestProperties (org.apereo.cas.configuration.model.core.web.security.HttpWebRequestProperties)2 ClientInfoThreadLocalFilter (org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter)2 Test (org.junit.Test)2 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)2 ConditionalOnProperty (org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)2 RegistrationBean (org.springframework.boot.web.servlet.RegistrationBean)2 WebStatFilter (com.alibaba.druid.support.http.WebStatFilter)1 CsrfFilter (com.erudika.scoold.utils.CsrfFilter)1 ServletContainer (com.sun.jersey.spi.container.servlet.ServletContainer)1 DispatcherType (javax.servlet.DispatcherType)1 ServletContext (javax.servlet.ServletContext)1 AuditProperties (org.apereo.cas.configuration.model.core.audit.AuditProperties)1 ThreadContextMDCServletFilter (org.apereo.cas.logging.web.ThreadContextMDCServletFilter)1