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


Java FilterRegistrationBean.setEnabled方法代碼示例

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


在下文中一共展示了FilterRegistrationBean.setEnabled方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: disableDefaultOAuth

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean disableDefaultOAuth(OAuth2AuthenticationProcessingFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean(filter);
    registration.setEnabled(false);
    return registration;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:7,代碼來源:AppMVCConfiguration.java

示例2: singleSignOutFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
/**
 * 注冊單點登出filter
 * @return
 */
@Bean
public FilterRegistrationBean singleSignOutFilter(){
    FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setName("singleSignOutFilter");
    bean.setFilter(new SingleSignOutFilter());
    bean.addUrlPatterns("/*");
    bean.setEnabled(true);
    //bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
    return bean;
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:15,代碼來源:ShiroCasConfiguration.java

示例3: delegatingFilterProxy

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
/**
 * 注冊DelegatingFilterProxy(Shiro)
 *
 * @return
 * @author SHANHY
 * @create  2016年1月13日
 */
@Bean
public FilterRegistrationBean delegatingFilterProxy() {
    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:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:18,代碼來源:ShiroCasConfiguration.java

示例4: filterRegistrationBean

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
/**
 * 注冊shiroFilter
 */
@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:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:14,代碼來源:ShiroConfig.java

示例5: shiroFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean shiroFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new DelegatingFilterProxy("shiroFilter"));
    //該值缺省為false,表示生命周期由SpringApplicationContext管理,設置為true則表示由ServletContainer管理
    registration.addInitParameter("targetFilterLifecycle", "true");
    registration.setEnabled(true);
    registration.setOrder(Integer.MAX_VALUE - 1);
    registration.addUrlPatterns("/*");
    return registration;
}
 
開發者ID:zhaoqicheng,項目名稱:renren-fast,代碼行數:12,代碼來源:FilterConfig.java

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

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

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean disableDefaultClientCredentials(
        ClientCredentialsTokenEndpointFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean(filter);
    registration.setEnabled(false);
    return registration;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:8,代碼來源:AppMVCConfiguration.java

示例9: juiserForwardedUserFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = "juiserForwardedUserFilter")
public FilterRegistrationBean juiserForwardedUserFilter() {

    ForwardedUserFilterConfig cfg = juiserForwardedUserFilterConfig();

    Filter filter = new SpringForwardedUserFilter(forwardedHeaderConfig().getName(),
        juiserRequestUserFactory(),
        cfg.getRequestAttributeNames());

    FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(filter);
    bean.setEnabled(cfg.isEnabled());
    bean.setMatchAfter(cfg.isMatchAfter());
    bean.setOrder(cfg.getOrder());

    Set<DispatcherType> dispatcherTypes = cfg.getDispatcherTypes();
    if (!CollectionUtils.isEmpty(dispatcherTypes)) {
        bean.setDispatcherTypes(EnumSet.copyOf(dispatcherTypes));
    }
    Set<String> set = cfg.getServletNames();
    if (!CollectionUtils.isEmpty(set)) {
        bean.setServletNames(set);
    }
    set = cfg.getUrlPatterns();
    if (!CollectionUtils.isEmpty(set)) {
        bean.setUrlPatterns(set);
    }

    return bean;
}
 
開發者ID:juiser,項目名稱:juiser,代碼行數:32,代碼來源:JuiserDefaultAutoConfiguration.java

示例10: disableDefaultUsernameAuth

import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean disableDefaultUsernameAuth(UsernamePasswordAuthenticationFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean(filter);
    registration.setEnabled(false);
    return registration;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:7,代碼來源:AppMVCConfiguration.java


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