當前位置: 首頁>>代碼示例>>Java>>正文


Java FilterRegistrationBean.addInitParameter方法代碼示例

本文整理匯總了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;
}
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:22,代碼來源:WicketWebInitializer.java

示例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;
}
 
開發者ID:hosken5,項目名稱:spring-boot-freemarker-showcase,代碼行數:13,代碼來源:SiteConfig.java

示例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;
}
 
開發者ID:mazhaoyong,項目名稱:api-server-seed,代碼行數:13,代碼來源:WebConfig.java

示例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;
  }
 
開發者ID:dewey-its,項目名稱:apollo-custom,代碼行數:13,代碼來源:CharacterEncodingFilterConfiguration.java

示例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;
}
 
開發者ID:johntostring,項目名稱:spring-boot-shiro,代碼行數:13,代碼來源:ShiroAutoConfiguration.java

示例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;
}
 
開發者ID:seagrape,項目名稱:kekoa,代碼行數:19,代碼來源:ShiroConfiguration.java

示例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;
}
 
開發者ID:seagrape,項目名稱:kekoa,代碼行數:19,代碼來源:KekoaShiroConfiguration.java

示例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;
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:16,代碼來源:JerseyAutoConfiguration.java

示例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;
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:9,代碼來源:SampleJersey1Application.java

示例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;
}
 
開發者ID:lumenrobot,項目名稱:lumen,代碼行數:12,代碼來源:WicketConfig.java

示例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;
}
 
開發者ID:lumenrobot,項目名稱:lumen,代碼行數:11,代碼來源:WicketConfig.java

示例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;
}
 
開發者ID:esutoniagodesu,項目名稱:egd-web,代碼行數:9,代碼來源:MultipartConfigurer.java

示例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;

}
 
開發者ID:shinyjunjun,項目名稱:myblog,代碼行數:26,代碼來源:DruidConfiguration.java


注:本文中的org.springframework.boot.context.embedded.FilterRegistrationBean.addInitParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。