本文整理汇总了Java中com.alibaba.druid.support.http.WebStatFilter类的典型用法代码示例。如果您正苦于以下问题:Java WebStatFilter类的具体用法?Java WebStatFilter怎么用?Java WebStatFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebStatFilter类属于com.alibaba.druid.support.http包,在下文中一共展示了WebStatFilter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filterRegistrationBean
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例2: statFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例3: druidStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例4: druidFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例5: druidStatFilter2
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例6: druidStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例7: druidStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}
示例8: webStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的package包/类
/**
* druid的url监控
* @return
*/
@Bean
public FilterRegistrationBean webStatFilter(){
WebStatFilter filter = new WebStatFilter();
FilterRegistrationBean bean = new FilterRegistrationBean(filter);
bean.addUrlPatterns("/*");
bean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,*.font,/druid/*");
return bean;
}
示例9: webStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的package包/类
/**
* druid监控Filter
* @return
*/
@Bean
public FilterRegistrationBean webStatFilter() {
FilterRegistrationBean bean = new FilterRegistrationBean(new WebStatFilter());
bean.addInitParameter("exclusions", "/css/*,/imgs/*,/js/*,/error/*,/druid/*");
return bean;
}
示例10: druidStatFilter
import com.alibaba.druid.support.http.WebStatFilter; //导入依赖的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;
}