当前位置: 首页>>代码示例>>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;未经允许,请勿转载。