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


Java FilterRegistrationBean.addUrlPatterns方法代码示例

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


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

示例1: 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:davichi11,项目名称:my-spring-boot-project,代码行数:11,代码来源:FilterConfig.java

示例2: aiFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean aiFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new WebRequestTrackingFilter());
    registration.addUrlPatterns("/**");
    registration.setOrder(1);
    return registration;
}
 
开发者ID:Microsoft,项目名称:movie-db-java-on-azure,代码行数:9,代码来源:AppInsightsConfig.java

示例3: 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:guolf,项目名称:pds,代码行数:12,代码来源:FilterConfig.java

示例4: cacheFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean cacheFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(cacheFilter());
    registration.addUrlPatterns("/icons/*", "/style/*", "/script/*", "/dwr/*", "/icons/*", "/coverArt.view", "/avatar.view");
    registration.addInitParameter("Cache-Control", "max-age=36000");
    registration.setName("CacheFilter");
    registration.setOrder(5);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:Application.java

示例5: jwtFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean jwtFilter() {
  final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
  registrationBean.setFilter(new JwtFilter());
  registrationBean.addUrlPatterns("/api/*");

  return registrationBean;
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:9,代码来源:WebApplication.java

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

示例7: objectifyFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean objectifyFilter(){
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new ObjectifyFilter());
    registration.addUrlPatterns("/*");
    registration.setOrder(1);

    return registration;
}
 
开发者ID:nhuttrung,项目名称:spring-data-objectify,代码行数:10,代码来源:ExampleApp.java

示例8: dawsonApiFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean dawsonApiFilter() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new ApiOriginFilter());
    registration.addUrlPatterns("/*");
    return registration;
}
 
开发者ID:whunmr,项目名称:spring-server,代码行数:8,代码来源:EnableApiOriginFilter.java

示例9: druidStatFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
/**
 * 注册FilterRegistrationBean
 * @return
 */
@Bean
public FilterRegistrationBean druidStatFilter() {
    FilterRegistrationBean bean = new FilterRegistrationBean(new WebStatFilter());
    //添加过滤规则.
    bean.addUrlPatterns("/*");
    //添加不需要忽略的格式信息.
    bean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid2/*");
    return bean;
}
 
开发者ID:finefuture,项目名称:data-migration,代码行数:14,代码来源:DruidConfiguration.java

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

示例11: statFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean statFilter(){
    //创建过滤器
    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
    //设置过滤器过滤路径
    filterRegistrationBean.addUrlPatterns("/*");
    //忽略过滤的形式
    filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
    return filterRegistrationBean;
}
 
开发者ID:SnailFastGo,项目名称:springboot_op,代码行数:11,代码来源:DruidConfiguration.java

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

示例13: someFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
/**
 * Some filter registration filter registration bean.
 *
 * @return the filter registration bean
 */
@Bean
public FilterRegistrationBean someFilterRegistration() {
    final FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(etagFilter());
    registration.addUrlPatterns("/api/*");
    registration.setName("etagFilter");
    registration.setOrder(1);
    return registration;
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:15,代码来源:SpringConfig.java

示例14: monitoringFilterRegistrationBean

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean monitoringFilterRegistrationBean() {
    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(this.managementSecurityRoleFilter);
    filterRegistrationBean.addUrlPatterns("/health*");
    filterRegistrationBean.setOrder(1);
    return filterRegistrationBean;
}
 
开发者ID:eclipse,项目名称:keti,代码行数:8,代码来源:AccessControlService.java

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


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