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


Java FilterRegistrationBean.setName方法代码示例

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


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

示例1: casCorsFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@ConditionalOnProperty(prefix = "cas.httpWebRequest.cors", name = "enabled", havingValue = "true")
@Bean
@RefreshScope
public FilterRegistrationBean casCorsFilter() {
    final HttpWebRequestProperties.Cors cors = casProperties.getHttpWebRequest().getCors();
    final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    final CorsConfiguration config = new CorsConfiguration();
    config.setAllowCredentials(cors.isEnabled());
    config.setAllowedOrigins(cors.getAllowOrigins());
    config.setAllowedMethods(cors.getAllowMethods());
    config.setAllowedHeaders(cors.getAllowHeaders());
    config.setMaxAge(cors.getMaxAge());
    config.setExposedHeaders(cors.getExposedHeaders());
    source.registerCorsConfiguration("/**", config);
    final FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
    bean.setName("casCorsFilter");
    bean.setAsyncSupported(true);
    bean.setOrder(0);
    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:CasFiltersConfiguration.java

示例2: responseHeadersSecurityFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@RefreshScope
@Bean
public FilterRegistrationBean responseHeadersSecurityFilter() {
    final HttpWebRequestProperties.Header header = casProperties.getHttpWebRequest().getHeader();
    final Map<String, String> initParams = new HashMap<>();
    initParams.put("enableCacheControl", BooleanUtils.toStringTrueFalse(header.isCache()));
    initParams.put("enableXContentTypeOptions", BooleanUtils.toStringTrueFalse(header.isXcontent()));
    initParams.put("enableStrictTransportSecurity", BooleanUtils.toStringTrueFalse(header.isHsts()));
    initParams.put("enableXFrameOptions", BooleanUtils.toStringTrueFalse(header.isXframe()));
    initParams.put("enableXSSProtection", BooleanUtils.toStringTrueFalse(header.isXss()));
    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new ResponseHeadersEnforcementFilter());
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setInitParameters(initParams);
    bean.setName("responseHeadersSecurityFilter");
    bean.setAsyncSupported(true);
    return bean;

}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:20,代码来源:CasFiltersConfiguration.java

示例3: requestParameterSecurityFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@RefreshScope
@Bean
public FilterRegistrationBean requestParameterSecurityFilter() {
    final Map<String, String> initParams = new HashMap<>();
    initParams.put(RequestParameterPolicyEnforcementFilter.PARAMETERS_TO_CHECK,
            casProperties.getHttpWebRequest().getParamsToCheck());
    initParams.put(RequestParameterPolicyEnforcementFilter.CHARACTERS_TO_FORBID, "none");
    initParams.put(RequestParameterPolicyEnforcementFilter.ALLOW_MULTI_VALUED_PARAMETERS,
            BooleanUtils.toStringTrueFalse(casProperties.getHttpWebRequest().isAllowMultiValueParameters()));
    initParams.put(RequestParameterPolicyEnforcementFilter.ONLY_POST_PARAMETERS,
            casProperties.getHttpWebRequest().getOnlyPostParams());

    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new RequestParameterPolicyEnforcementFilter());
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setName("requestParameterSecurityFilter");
    bean.setInitParameters(initParams);
    bean.setAsyncSupported(true);
    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:CasFiltersConfiguration.java

示例4: casClientInfoLoggingFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean casClientInfoLoggingFilter() {
    final AuditProperties audit = casProperties.getAudit();

    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new ClientInfoThreadLocalFilter());
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setName("CAS Client Info Logging Filter");
    bean.setAsyncSupported(true);
    bean.setOrder(Ordered.HIGHEST_PRECEDENCE);

    final Map<String, String> initParams = new HashMap<>();
    if (StringUtils.isNotBlank(audit.getAlternateClientAddrHeaderName())) {
        initParams.put(ClientInfoThreadLocalFilter.CONST_IP_ADDRESS_HEADER, audit.getAlternateClientAddrHeaderName());
    }

    if (StringUtils.isNotBlank(audit.getAlternateServerAddrHeaderName())) {
        initParams.put(ClientInfoThreadLocalFilter.CONST_SERVER_IP_ADDRESS_HEADER, audit.getAlternateServerAddrHeaderName());
    }

    initParams.put(ClientInfoThreadLocalFilter.CONST_USE_SERVER_HOST_ADDRESS, String.valueOf(audit.isUseServerHostAddress()));
    bean.setInitParameters(initParams);
    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:25,代码来源:CasCoreAuditConfiguration.java

示例5: characterEncodingFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean characterEncodingFilterRegistration() {
    FilterRegistrationBean registrationBean =
            new FilterRegistrationBean(characterEncodingFilter());
    registrationBean.setName("CharacterEncodingFilter");
    registrationBean.addUrlPatterns("/*");
    registrationBean.setOrder(1);
    return registrationBean;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:10,代码来源:CasConfig.java

示例6: setRestApiFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean setRestApiFilter() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(historyFilter);
    registration.addUrlPatterns("/api/engine/engine/default/task/*");
    registration.setName("historyFilter");
    registration.setOrder(Integer.MAX_VALUE - 1);
    return registration;
}
 
开发者ID:IntegrityVision,项目名称:Purchase-order-process-template,代码行数:10,代码来源:Config.java

示例7: csrfFilterRegistrationBean

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
/**
 * @return CSRF protection filter bean
 */
@Bean
public FilterRegistrationBean csrfFilterRegistrationBean() {
	String path = "/*";
	logger.debug("Initializing CSRF filter [{}]...", path);
	FilterRegistrationBean frb = new FilterRegistrationBean(new CsrfFilter());
	frb.setDispatcherTypes(EnumSet.of(DispatcherType.REQUEST));
	frb.setName("csrfFilter");
	frb.setAsyncSupported(true);
	frb.addUrlPatterns(path);
	frb.setMatchAfter(false);
	frb.setEnabled(true);
	frb.setOrder(2);
	return frb;
}
 
开发者ID:Erudika,项目名称:scoold,代码行数:18,代码来源:ScooldServer.java

示例8: xssFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean xssFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setDispatcherTypes(DispatcherType.REQUEST);
    registration.setFilter(new XssFilter());
    registration.addUrlPatterns("/*");
    registration.setName("xssFilter");
    registration.setOrder(Integer.MAX_VALUE);
    return registration;
}
 
开发者ID:guolf,项目名称:pds,代码行数:11,代码来源:FilterConfig.java

示例9: corsFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean corsFilterRegistration() {
    FilterRegistrationBean registrationBean =
            new FilterRegistrationBean(new CORSFilter());
    registrationBean.setName("CORS Filter");
    registrationBean.addUrlPatterns("/*");
    registrationBean.setOrder(1);
    return registrationBean;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:10,代码来源:CORSFilterConfig.java

示例10: bootstrapVerificationFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean bootstrapVerificationFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(bootstrapVerificationFiler());
    registration.addUrlPatterns("/*");
    registration.setName("BootstrapVerificationFilter");
    registration.setOrder(1);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:10,代码来源:Application.java

示例11: parameterDecodingFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean parameterDecodingFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(parameterDecodingFilter());
    registration.addUrlPatterns("/*");
    registration.setName("ParameterDecodingFilter");
    registration.setOrder(2);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:10,代码来源:Application.java

示例12: restFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean restFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(restFilter());
    registration.addUrlPatterns("/rest/*");
    registration.setName("RESTFilter");
    registration.setOrder(3);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:10,代码来源:Application.java

示例13: requestEncodingFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean requestEncodingFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(requestEncodingFilter());
    registration.addUrlPatterns("/*");
    registration.addInitParameter("encoding", "UTF-8");
    registration.setName("RequestEncodingFilter");
    registration.setOrder(4);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:Application.java

示例14: noCacheFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean noCacheFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(noCacheFilter());
    registration.addUrlPatterns("/statusChart.view", "/userChart.view", "/playQueue.view", "/podcastChannels.view", "/podcastChannel.view", "/help.view", "/top.view", "/home.view");
    registration.addInitParameter("Cache-Control", "no-cache, post-check=0, pre-check=0");
    registration.addInitParameter("Pragma", "no-cache");
    registration.addInitParameter("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
    registration.setName("NoCacheFilter");
    registration.setOrder(6);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:13,代码来源:Application.java

示例15: requestContextFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean requestContextFilter() {
    final FilterRegistrationBean filterRegBean = new FilterRegistrationBean();
    filterRegBean.setFilter(new RequestContextFilter());
    filterRegBean.addUrlPatterns("*");
    filterRegBean.setEnabled(Boolean.TRUE);
    filterRegBean.setName("RequestContextFilter");
    return filterRegBean;
}
 
开发者ID:expansel,项目名称:errai-spring-boot-sample,代码行数:10,代码来源:Application.java


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