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


Java FilterRegistrationBean.addInitParameter方法代码示例

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


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

示例1: filterRegistrationBean

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean filterRegistrationBean(DruidDataSourceProperties druidDataSourceProperties) {
    log.debug("druid web-stat-filter init...");
    DruidWebStatProperties properties = druidDataSourceProperties.getWebStat();
    FilterRegistrationBean registration = new FilterRegistrationBean();
    WebStatFilter filter = new WebStatFilter();
    registration.setFilter(filter);
    registration.addUrlPatterns(properties.getUrlPatterns());
    registration.addInitParameter("exclusions", properties.getExclusions());
    registration.addInitParameter("sessionStatEnable", Boolean.toString(properties.isSessionStatEnable()));
    if (!StringUtils.isEmpty(properties.getSessionStatMaxCount())) {
        registration.addInitParameter("sessionStatMaxCount",Integer.toString(properties.getSessionStatMaxCount()));
    }
    if (!StringUtils.isEmpty(properties.getPrincipalSessionName())) {
        registration.addInitParameter("principalSessionName", properties.getPrincipalSessionName());
    }
    if (!StringUtils.isEmpty(properties.getPrincipalCookieName())) {
        registration.addInitParameter("principalCookieName", properties.getPrincipalCookieName());
    }
    registration.addInitParameter("profileEnable", Boolean.toString(properties.isProfileEnable()));
    return registration;
}
 
开发者ID:drtrang,项目名称:druid-spring-boot,代码行数:23,代码来源:DruidStatConfiguration.java

示例2: 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:lpj24,项目名称:jobManage,代码行数:11,代码来源:DruidConfiguration.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: 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:Zigin,项目名称:MonitorPlatform,代码行数:14,代码来源:DruidConfiguration.java

示例7: myFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean myFilter(){
	FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
	filterRegistrationBean.setFilter(new MyFilter());
	filterRegistrationBean.setName("myFilter");
	filterRegistrationBean.addUrlPatterns("/*");
	filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
	return filterRegistrationBean;
}
 
开发者ID:cairenjie1985,项目名称:springBoot-demo,代码行数:10,代码来源:SpringBootDemoApplication.java

示例8: requestEncodingFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean requestEncodingFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(requestEncodingFilter());
    registration.addUrlPatterns("/*");
    registration.addInitParameter("encoding", "UTF-8");
    registration.setName("RequestEncodingFilter");
    registration.setOrder(4);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:Application.java

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

示例10: noCacheFilterRegistration

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
public FilterRegistrationBean noCacheFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(noCacheFilter());
    registration.addUrlPatterns("/statusChart.view", "/userChart.view", "/playQueue.view", "/podcastChannels.view", "/podcastChannel.view", "/help.view", "/top.view", "/home.view");
    registration.addInitParameter("Cache-Control", "no-cache, post-check=0, pre-check=0");
    registration.addInitParameter("Pragma", "no-cache");
    registration.addInitParameter("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
    registration.setName("NoCacheFilter");
    registration.setOrder(6);
    return registration;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:13,代码来源:Application.java

示例11: druidFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
@Bean
@ConfigurationProperties(DruidFilterProperties.DRUID_FILTER_PREFIX)
public FilterRegistrationBean druidFilter(DruidFilterProperties properties) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    WebStatFilter filter = new WebStatFilter();
    registration.setFilter(filter);
    registration.addUrlPatterns(properties.getUrlPattern());
    registration.addInitParameter("exclusions",properties.getExclusions());
    registration.addInitParameter("sessionStatMaxCount",properties.getSessionStatMaxCount().toString());
    registration.addInitParameter("sessionStatEnable",properties.getSessionStatEnable().toString());
    registration.addInitParameter("principalSessionName",properties.getPrincipalSessionName());
    registration.addInitParameter("principalCookieName",properties.getPrincipalCookieName());
    registration.addInitParameter("profileEnable",properties.getProfileEnable().toString());
    return registration;
}
 
开发者ID:cuisongliu,项目名称:druid-boot-starter,代码行数:16,代码来源:DruidFilterAutoConfiguration.java

示例12: druidStatFilter2

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

示例13: druidStatFilter

import org.springframework.boot.web.servlet.FilterRegistrationBean; //导入方法依赖的package包/类
/**
 * 注册一个:filterRegistrationBean
 * @return
 */
@Bean
public FilterRegistrationBean druidStatFilter(){

    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
    //添加过滤规则.
    filterRegistrationBean.addUrlPatterns("/*");
    //添加不需要忽略的格式信息.
    filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
    return filterRegistrationBean;
}
 
开发者ID:hulvyou,项目名称:spring-cloud-template,代码行数:15,代码来源:DruidConfig.java

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


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