本文整理汇总了Java中org.springframework.boot.context.embedded.FilterRegistrationBean.addInitParameter方法的典型用法代码示例。如果您正苦于以下问题:Java FilterRegistrationBean.addInitParameter方法的具体用法?Java FilterRegistrationBean.addInitParameter怎么用?Java FilterRegistrationBean.addInitParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.context.embedded.FilterRegistrationBean
的用法示例。
在下文中一共展示了FilterRegistrationBean.addInitParameter方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wicketFilterRegistration
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean wicketFilterRegistration() {
FilterRegistrationBean registration = new FilterRegistrationBean();
WicketFilter wicketFilter = new WicketFilter();
registration.setFilter(wicketFilter);
registration.setName("wicketFilter");
registration.addInitParameter(WicketFilter.APP_FACT_PARAM,
SpringWebApplicationFactory.class.getName());
registration.addInitParameter("configuration", configuration);
registration.addInitParameter("testsMode", String.valueOf(testMode));
registration.addInitParameter("mockMode",String.valueOf(mockMode));
registration.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/portal/*");
registration.addInitParameter(WicketFilter.IGNORE_PATHS_PARAM,"/favicon.ico");
registration.addUrlPatterns("/portal/*");
registration.setDispatcherTypes(DispatcherType.REQUEST,DispatcherType.FORWARD);
registration.setMatchAfter(true);
return registration;
}
示例2: rewriteFilterConfig
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean rewriteFilterConfig() {
FilterRegistrationBean reg = new FilterRegistrationBean();
reg.setName(REWRITE_FILTER_NAME);
reg.setFilter(new UrlRewriteFilter());
reg.addInitParameter("confPath", REWRITE_FILTER_CONF_PATH);
reg.addInitParameter("confReloadCheckInterval", "-1");
reg.addInitParameter("statusPath", "/redirect");
reg.addInitParameter("statusEnabledOnHosts", "*");
reg.addInitParameter("logLevel", "WARN");
return reg;
}
示例3: webStatFilter
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
/**
* druid的url监控
* @return
*/
@Bean
public FilterRegistrationBean webStatFilter(){
WebStatFilter filter = new WebStatFilter();
FilterRegistrationBean bean = new FilterRegistrationBean(filter);
bean.addUrlPatterns("/*");
bean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,*.font,/druid/*");
return bean;
}
示例4: encodingFilter
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean encodingFilter() {
FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new CharacterEncodingFilter());
bean.addInitParameter("encoding", "UTF-8");
//FIXME: https://github.com/Netflix/eureka/issues/702
// bean.addInitParameter("forceEncoding", "true");
bean.setName("encodingFilter");
bean.addUrlPatterns("/*");
bean.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD);
return bean;
}
示例5: filterRegistrationBean
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean(name = "shiroFilter")
@DependsOn("securityManager")
@ConditionalOnMissingBean
public FilterRegistrationBean filterRegistrationBean(SecurityManager securityManager) throws Exception {
FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
//该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理
filterRegistration.addInitParameter("targetFilterLifecycle", "true");
filterRegistration.setFilter((Filter) getShiroFilterFactoryBean(securityManager).getObject());
filterRegistration.setEnabled(true);
filterRegistration.addUrlPatterns("/*");
return filterRegistration;
}
示例6: filterRegistrationBean
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
/**
* 注册DelegatingFilterProxy(Shiro)
*
* @param dispatcherServlet
* @return
* @author SHANHY
* @create 2016年1月13日
*/
@Bean
public FilterRegistrationBean filterRegistrationBean() {
FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
filterRegistration.setFilter(new DelegatingFilterProxy("shiroFilter"));
// 该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理
filterRegistration.addInitParameter("targetFilterLifecycle", "true");
filterRegistration.setEnabled(true);
filterRegistration.addUrlPatterns("/*");
return filterRegistration;
}
示例7: filterRegistrationBean
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
/**
* 注册DelegatingFilterProxy(Shiro)
*
* @param dispatcherServlet
* @return
* @author SHANHY
* @create 2016年1月13日
*/
@Bean
public FilterRegistrationBean filterRegistrationBean() {
FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
filterRegistration.setFilter(new DelegatingFilterProxy("shiroFilter"));
// 该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理
filterRegistration.addInitParameter("targetFilterLifecycle", "true");
// filterRegistration.setEnabled(true);
filterRegistration.addUrlPatterns("/*");
return filterRegistration;
}
示例8: jerseyFilterRegistration
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean(name = "jerseyFilterRegistration")
@ConditionalOnProperty(prefix = "spring.jersey", name = "type", havingValue = "filter")
public FilterRegistrationBean jerseyFilterRegistration() {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new ServletContainer(this.config));
registration.setUrlPatterns(Arrays.asList(this.path));
registration.setOrder(this.jersey.getFilter().getOrder());
registration.addInitParameter(ServletProperties.FILTER_CONTEXT_PATH,
stripPattern(this.path));
addInitParameters(registration);
registration.setName("jerseyFilter");
registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
return registration;
}
示例9: jersey
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean jersey() {
FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ServletContainer());
bean.addInitParameter("com.sun.jersey.config.property.packages",
"com.sun.jersey;sample.jersey1");
return bean;
}
示例10: wicketFilter
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean @DependsOn("openEntityManagerInViewFilter")
public FilterRegistrationBean wicketFilter() {
final FilterRegistrationBean reg = new FilterRegistrationBean(new WicketFilter());
reg.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
reg.addInitParameter(WicketFilter.APP_FACT_PARAM, SpringWebApplicationFactory.class.getName());
reg.addInitParameter("applicationBean", "webApp");
final RuntimeConfigurationType wicketConfiguration =
env.getRequiredProperty("wicket.configuration", RuntimeConfigurationType.class);
reg.addInitParameter("configuration", wicketConfiguration.name());
return reg;
}
示例11: wicketFilter
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean wicketFilter() {
final FilterRegistrationBean reg = new FilterRegistrationBean(new WicketFilter());
reg.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
reg.addInitParameter(WicketFilter.APP_FACT_PARAM, SpringWebApplicationFactory.class.getName());
reg.addInitParameter("applicationBean", "webApp");
reg.addInitParameter("configuration", env.getRequiredProperty("wicket.configuration"));
// reg.addInitParameter("applicationClassName", MyWebApplication.class.name);
return reg;
}
示例12: multipartFilterRegistrationBean
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean multipartFilterRegistrationBean() {
log.debug("New instance of " + FilterRegistrationBean.class);
final MultipartFilter multipartFilter = new MultipartFilter();
final FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(multipartFilter);
filterRegistrationBean.addInitParameter("multipartResolverBeanName", "multipartResolver");
return filterRegistrationBean;
}
示例13: druidStatFilter
import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
/**
*
* 注册一个:filterRegistrationBean
*
* @return
*
*/
@Bean
public FilterRegistrationBean druidStatFilter() {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
// 添加过滤规则.
filterRegistrationBean.addUrlPatterns("/*");
// 添加忽略的格式信息.
filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
return filterRegistrationBean;
}