bug fixed for WebStatFilter NullPointerException

This commit is contained in:
wenshao
2013-05-10 12:42:14 +08:00
parent 5ac865d41a
commit fc2857a597
2 changed files with 88 additions and 3 deletions
@@ -191,7 +191,7 @@ public class WebStatFilter implements Filter {
if (isProfileEnable()) {
Profiler.release(nanos);
Map<ProfileEntryKey, ProfileEntryReqStat> requestStatsMap = Profiler.getStatsMap();
if (uriStat != null) {
uriStat.getProfiletat().record(requestStatsMap);
@@ -382,8 +382,9 @@ public class WebStatFilter implements Filter {
StatFilterContext.getInstance().addContextListener(statFilterContextListener);
this.contextPath = DruidWebUtils.getContextPath(config.getServletContext());
webAppStat = new WebAppStat(contextPath, this.sessionStatMaxCount);
if (webAppStat == null) {
webAppStat = new WebAppStat(contextPath, this.sessionStatMaxCount);
}
WebAppStatManager.getInstance().addWebAppStatSet(webAppStat);
}
@@ -412,6 +413,10 @@ public class WebStatFilter implements Filter {
this.profileEnable = profileEnable;
}
public void setWebAppStat(WebAppStat webAppStat) {
this.webAppStat = webAppStat;
}
public WebAppStat getWebAppStat() {
return webAppStat;
}