当前位置: 首页>>代码示例>>Java>>正文


Java FilterRegistrationBean.setFilter方法代码示例

本文整理汇总了Java中org.springframework.boot.context.embedded.FilterRegistrationBean.setFilter方法的典型用法代码示例。如果您正苦于以下问题:Java FilterRegistrationBean.setFilter方法的具体用法?Java FilterRegistrationBean.setFilter怎么用?Java FilterRegistrationBean.setFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.boot.context.embedded.FilterRegistrationBean的用法示例。


在下文中一共展示了FilterRegistrationBean.setFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: authenticationFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean authenticationFilter() {
  FilterRegistrationBean casFilter = new FilterRegistrationBean();

  Map<String, String> filterInitParam = Maps.newHashMap();
  filterInitParam.put("redisClusterName", "casClientPrincipal");
  filterInitParam.put("serverName", portalConfig.portalServerName());
  filterInitParam.put("casServerLoginUrl", portalConfig.casServerLoginUrl());
  //we don't want to use session to store login information, since we will be deployed to a cluster, not a single instance
  filterInitParam.put("useSession", "false");
  filterInitParam.put("/openapi.*", "exclude");

  casFilter.setInitParameters(filterInitParam);
  casFilter.setFilter(filter("com.ctrip.framework.apollo.sso.filter.ApolloAuthenticationFilter"));
  casFilter.addUrlPatterns("/*");
  casFilter.setOrder(2);

  return casFilter;
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:20,代码来源:AuthConfiguration.java

示例3: 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

示例4: mongoFilterBean

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean mongoFilterBean() {
  FilterRegistrationBean registrationBean = new FilterRegistrationBean();
  registrationBean.setFilter(mongoFilter);
  List<String> urls = new ArrayList<String>();
  
  urls.add("/");
  urls.add("/user");
  urls.add("/login");
  urls.add("/history/*");
  urls.add("/features/*");
  urls.add("/admin/*");
  urls.add("/pipelines/*");
  urls.add("/api/output/*");
  
  registrationBean.setUrlPatterns(urls);
  return registrationBean;
}
 
开发者ID:Apereo-Learning-Analytics-Initiative,项目名称:LearningAnalyticsProcessor,代码行数:19,代码来源:MongoMultiTenantConfiguration.java

示例5: corsFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean corsFilter()
{
	FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
	filterRegistrationBean.setFilter(new CORSFilter());
	filterRegistrationBean.setDispatcherTypes(DispatcherType.REQUEST);
	filterRegistrationBean.setUrlPatterns(Arrays.asList("/*"));
	filterRegistrationBean.setOrder(Integer.MIN_VALUE + 1000);
	return filterRegistrationBean;
}
 
开发者ID:tmply,项目名称:tmply,代码行数:11,代码来源:WebMvcConfig.java

示例6: httpMethodFilterRegistration

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean httpMethodFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(httpMethodFilter());
    registration.addUrlPatterns("/*");
    registration.setName("httpMethodFilter");
    registration.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
    return registration;
}
 
开发者ID:melthaw,项目名称:spring-backend-boilerplate,代码行数:10,代码来源:OpenApiWebMvcConfigurer.java

示例7: openApiAuthenticationFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean openApiAuthenticationFilter(ConsumerAuthUtil consumerAuthUtil,
                                                          ConsumerAuditUtil consumerAuditUtil) {
  FilterRegistrationBean openApiFilter = new FilterRegistrationBean();

  openApiFilter.setFilter(new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil));
  openApiFilter.addUrlPatterns("/openapi/*");

  return openApiFilter;
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:11,代码来源:AuthFilterConfiguration.java

示例8: casFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean casFilter() {
  FilterRegistrationBean singleSignOutFilter = new FilterRegistrationBean();
  singleSignOutFilter.setFilter(filter("org.jasig.cas.client.session.SingleSignOutFilter"));
  singleSignOutFilter.addUrlPatterns("/*");
  singleSignOutFilter.setOrder(1);
  return singleSignOutFilter;
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:9,代码来源:AuthConfiguration.java

示例9: assertionHolder

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean assertionHolder() {
  FilterRegistrationBean assertionHolderFilter = new FilterRegistrationBean();

  Map<String, String> filterInitParam = Maps.newHashMap();
  filterInitParam.put("/openapi.*", "exclude");

  assertionHolderFilter.setInitParameters(filterInitParam);

  assertionHolderFilter.setFilter(filter("com.ctrip.framework.apollo.sso.filter.ApolloAssertionThreadLocalFilter"));
  assertionHolderFilter.addUrlPatterns("/*");
  assertionHolderFilter.setOrder(4);

  return assertionHolderFilter;
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:16,代码来源:AuthConfiguration.java

示例10: userAccessFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean userAccessFilter() {
  FilterRegistrationBean filter = new FilterRegistrationBean();
  filter.setFilter(new UserAccessFilter(userInfoHolder));
  filter.addUrlPatterns("/*");
  return filter;
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:8,代码来源:WebContextConfiguration.java

示例11: 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

示例12: filterRegistrationBean

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean filterRegistrationBean() {
	final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
	final StrutsPrepareAndExecuteFilter struts = new StrutsPrepareAndExecuteFilter();
	registrationBean.setFilter(struts);
	registrationBean.setOrder(1);
	return registrationBean;
}
 
开发者ID:jrrdev,项目名称:cve-2017-5638,代码行数:9,代码来源:AppConfiguration.java

示例13: mdcLoggingFilter

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean mdcLoggingFilter() {
    FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new MDCLoggingFilter());
    bean.setOrder(1);
    return bean;
}
 
开发者ID:sinsengumi,项目名称:spring-boot-application-infrastructure,代码行数:8,代码来源:WebConfig.java

示例14: 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

示例15: FilterRegistrationBean

import org.springframework.boot.context.embedded.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean()
FilterRegistrationBean FilterRegistrationBean() {
    final FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
    filterRegistrationBean.setFilter(new DelegatingFilterProxy("springSecurityFilterChain"));
    filterRegistrationBean.setName("springSecurityFilterChain");
    filterRegistrationBean.addUrlPatterns("/api/*");
    return filterRegistrationBean;
}
 
开发者ID:tvajjala,项目名称:interview-preparation,代码行数:9,代码来源:WebSecurityConfig.java


注:本文中的org.springframework.boot.context.embedded.FilterRegistrationBean.setFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。