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


Java FilterRegistrationBean.setAsyncSupported方法代碼示例

本文整理匯總了Java中org.springframework.boot.web.servlet.FilterRegistrationBean.setAsyncSupported方法的典型用法代碼示例。如果您正苦於以下問題:Java FilterRegistrationBean.setAsyncSupported方法的具體用法?Java FilterRegistrationBean.setAsyncSupported怎麽用?Java FilterRegistrationBean.setAsyncSupported使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.web.servlet.FilterRegistrationBean的用法示例。


在下文中一共展示了FilterRegistrationBean.setAsyncSupported方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: casClientInfoLoggingFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean casClientInfoLoggingFilter() {
    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new ClientInfoThreadLocalFilter());
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setName("CAS Client Info Logging Filter");
    bean.setAsyncSupported(true);
    return bean;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:10,代碼來源:CasManagementAuditConfiguration.java

示例6: characterEncodingFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@RefreshScope
@Bean
public FilterRegistrationBean characterEncodingFilter() {
    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new CharacterEncodingFilter(
            casProperties.getHttpWebRequest().getWeb().getEncoding(),
            casProperties.getHttpWebRequest().getWeb().isForceEncoding()));
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setName("characterEncodingFilter");
    bean.setAsyncSupported(true);
    return bean;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:13,代碼來源:CasFiltersConfiguration.java

示例7: currentCredentialsAndAuthenticationClearingFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean currentCredentialsAndAuthenticationClearingFilter() {
    final FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new AuthenticationCredentialsLocalBinderClearingFilter());
    bean.setUrlPatterns(Collections.singleton("/*"));
    bean.setName("currentCredentialsAndAuthenticationClearingFilter");
    bean.setAsyncSupported(true);
    return bean;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:10,代碼來源:CasFiltersConfiguration.java

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

示例9: springSecurityFilterChain

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean springSecurityFilterChain() {
    FilterRegistrationBean registrationBean = new FilterRegistrationBean();
    DelegatingFilterProxy securityFilter = new DelegatingFilterProxy();
    registrationBean.setFilter(securityFilter);
    registrationBean.setAsyncSupported(true);
    registrationBean.addUrlPatterns("/*");
    return registrationBean;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:10,代碼來源:AppMVCConfiguration.java


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