當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。