com.alibaba.druid.support.http.WebStatFilter Java Examples
The following examples show how to use
com.alibaba.druid.support.http.WebStatFilter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DruidStatConfiguration.java From druid-spring-boot with Apache License 2.0 | 6 votes |
@Bean public FilterRegistrationBean druidWebStatFilter(DruidDataSourceProperties druidProperties) { log.debug("druid web-stat-filter init..."); DruidWebStatProperties properties = druidProperties.getWebStat(); FilterRegistrationBean registration = new FilterRegistrationBean(new WebStatFilter()); 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; }
Example #2
Source File: DruidConfiguration.java From springBoot-study with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean( new WebStatFilter()); // 添加过滤规则 filterRegistrationBean.addUrlPatterns("/*"); // 添加不需要忽略的格式信息 filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); System.out.println("druid初始化成功!"); return filterRegistrationBean; }
Example #3
Source File: WebConfig.java From platform with Apache License 2.0 | 5 votes |
/** * WebStatFilter * * @return {@link WebStatFilter} */ @Bean @ConditionalOnWebApplication public FilterRegistrationBean<WebStatFilter> druidStatFilter() { FilterRegistrationBean<WebStatFilter> bean = new FilterRegistrationBean<>(new WebStatFilter()); bean.addUrlPatterns("/*"); bean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/static/*,/resources/*,/mobile/*,/app-update/*"); return bean; }
Example #4
Source File: DruidMonitorConfig.java From spring-boot-cookbook with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { /* Web关联监控配置: WebStatFilter用于采集web-jdbc关联监控的数据。为StatViewServlet准备用来展示的数据*/ WebStatFilter filter = new WebStatFilter(); FilterRegistrationBean registrationBean = new FilterRegistrationBean(filter); registrationBean.addUrlPatterns("/*"); // 经常需要排除一些不必要的url,比如*.js,/jslib等等。配置在init-param中。比如: registrationBean.addInitParameter(WebStatFilter.PARAM_NAME_EXCLUSIONS, "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); // druid 0.2.7版本开始支持profile,配置profileEnable能够监控单个url调用的sql列表。 registrationBean.addInitParameter(WebStatFilter.PARAM_NAME_PROFILE_ENABLE, Boolean.TRUE.toString()); return registrationBean; }
Example #5
Source File: WebConfig.java From api-server-seed with Apache License 2.0 | 5 votes |
/** * 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; }
Example #6
Source File: DruidAutoConfig.java From springboot-seed with MIT License | 5 votes |
@Bean public FilterRegistrationBean druidStatFilter2() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return filterRegistrationBean; }
Example #7
Source File: WebConfig.java From Guns with GNU Lesser General Public License v3.0 | 5 votes |
/** * druid监控 配置URI拦截策略 */ @Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter( "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 filterRegistrationBean.addInitParameter("principalSessionName", "username"); return filterRegistrationBean; }
Example #8
Source File: DruidConfiguration.java From LazyREST with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean statFilter() { //创建过滤器 FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //设置过滤器过滤路径 filterRegistrationBean.addUrlPatterns("/*"); //忽略过滤的形式 filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return filterRegistrationBean; }
Example #9
Source File: DruidConfiguration.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 注册一个:filterRegistrationBean * * @return */ //@Bean public FilterRegistrationBean druidStatFilter2() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid2/*"); return filterRegistrationBean; }
Example #10
Source File: DruidConfig.java From Doctor with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.js,*.css,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #11
Source File: DruidConfig.java From SpringBoot-Base-System with GNU Lesser General Public License v3.0 | 5 votes |
/** * 不拦截的 * * @time 2018年4月10日 下午5:00:08. * @version V1.0 * @return FilterRegistrationBean */ @Bean public FilterRegistrationBean statFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); filterRegistrationBean.addUrlPatterns("/*"); filterRegistrationBean.addInitParameter("exclusions", "*.my,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return filterRegistrationBean; }
Example #12
Source File: DruidConfig.java From blog with BSD 2-Clause "Simplified" License | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean<WebStatFilter> bean = new FilterRegistrationBean<>(new WebStatFilter()); HashMap<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "/css,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #13
Source File: DruidConfiguration.java From spring-boot-seed with MIT License | 5 votes |
/** * 注入Druid的WebStatFilter * * @return filter */ @Bean public FilterRegistrationBean druidWebStatFilter() { FilterRegistrationBean<WebStatFilter> filterRegistrationBean = new FilterRegistrationBean<>(new WebStatFilter()); // 过滤规则 filterRegistrationBean.addUrlPatterns("/*"); // 过滤忽略格式 filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return filterRegistrationBean; }
Example #14
Source File: DruidMonitorConfigurer.java From FlyCms with MIT License | 5 votes |
/** * 注册FilterRegistrationBean * @return */ @Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. bean.addUrlPatterns("/admin/*"); //添加不需要忽略的格式信息. //bean.addInitParameter("/assets/**","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return bean; }
Example #15
Source File: DruidMonitorConfigurer.java From mySpringBoot with Apache License 2.0 | 5 votes |
/** * 注册FilterRegistrationBean * @return */ @Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. bean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. bean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return bean; }
Example #16
Source File: DruidConfig.java From codeway_service with GNU General Public License v3.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.js,*.css,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #17
Source File: DruidConfig.java From ZTuoExchange_framework with MIT License | 5 votes |
/** * 注册一个:filterRegistrationBean * @return */ @Bean public FilterRegistrationBean druidStatFilter(){ FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/my/druid/*"); return filterRegistrationBean; }
Example #18
Source File: DruidMonitorConfig.java From spring-boot-shiro with Apache License 2.0 | 5 votes |
/** * 注册FilterRegistrationBean * @return */ @Bean public FilterRegistrationBean<WebStatFilter> druidStatFilter() { FilterRegistrationBean<WebStatFilter> bean = new FilterRegistrationBean<>(new WebStatFilter()); //添加过滤规则. bean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. bean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return bean; }
Example #19
Source File: DruidConfiguration.java From youkefu with Apache License 2.0 | 5 votes |
/** * 注册一个:filterRegistrationBean * @return */ @Bean public FilterRegistrationBean druidStatFilter2(){ FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid2/*"); return filterRegistrationBean; }
Example #20
Source File: DruidConfiguration.java From pmq with Apache License 2.0 | 5 votes |
/** * 注册一个:WebStatFilter * @return */ @Bean public FilterRegistrationBean druidStatFilter2(){ FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); /** 过滤规则 */ filterRegistrationBean.addUrlPatterns("/*"); /** 忽略资源 */ filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid2/*"); return filterRegistrationBean; }
Example #21
Source File: DruidConfig.java From mogu_blog_v2 with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.vue,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #22
Source File: DruidConfig.java From mogu_blog_v2 with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.vue,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #23
Source File: DruidConfig.java From mogu_blog_v2 with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.vue,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }
Example #24
Source File: DruidConfiguration.java From springBoot-study with Apache License 2.0 | 5 votes |
@Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean( new WebStatFilter()); // 添加过滤规则 filterRegistrationBean.addUrlPatterns("/*"); // 添加不需要忽略的格式信息 filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); System.out.println("druid初始化成功!"); return filterRegistrationBean; }
Example #25
Source File: WebConfig.java From MeetingFilm with Apache License 2.0 | 5 votes |
/** * druid监控 配置URI拦截策略 */ @Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter( "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 filterRegistrationBean.addInitParameter("principalSessionName", "username"); return filterRegistrationBean; }
Example #26
Source File: DruidStatConfig.java From frpMgr with MIT License | 5 votes |
/** * 注册DruidFilter拦截 */ @Bean public FilterRegistrationBean duridFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); bean.addInitParameter("exclusions", "*.css,*.js,*.png," + "*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html," + "*.crx,*.xpi,*.exe,*.ipa,*.apk,*.otf,*.eot,*.svg,*.ttf,*.woff," + "/druid/*"); bean.addUrlPatterns("/*"); return bean; }
Example #27
Source File: DruidConfiguration.java From seata-samples with Apache License 2.0 | 5 votes |
/** * 注册一个:filterRegistrationBean * * @return filter registration bean */ @Bean public FilterRegistrationBean<WebStatFilter> druidStatFilter() { FilterRegistrationBean<WebStatFilter> filterRegistrationBean = new FilterRegistrationBean<WebStatFilter>( new WebStatFilter()); // 添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); // 添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); return filterRegistrationBean; }
Example #28
Source File: WebConfig.java From WebStack-Guns with MIT License | 5 votes |
/** * druid监控 配置URI拦截策略 */ @Bean public FilterRegistrationBean druidStatFilter() { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter( "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 filterRegistrationBean.addInitParameter("principalSessionName", "username"); return filterRegistrationBean; }
Example #29
Source File: DruidConfig.java From ZTuoExchange_framework with MIT License | 5 votes |
/** * 注册一个:filterRegistrationBean * @return */ @Bean public FilterRegistrationBean druidStatFilter(){ FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); //添加过滤规则. filterRegistrationBean.addUrlPatterns("/*"); //添加不需要忽略的格式信息. filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/my/druid/*"); return filterRegistrationBean; }
Example #30
Source File: DruidConfig.java From codeway_service with GNU General Public License v3.0 | 5 votes |
@Bean public FilterRegistrationBean webStatFilter() { FilterRegistrationBean bean = new FilterRegistrationBean(); bean.setFilter(new WebStatFilter()); Map<String, String> initParams = new HashMap<>(); initParams.put("exclusions", "*.js,*.css,/druid/*"); bean.setInitParameters(initParams); bean.setUrlPatterns(Arrays.asList("/*")); return bean; }