diff --git a/spring-mvc-xml/src/main/webapp/WEB-INF/web.xml b/spring-mvc-xml/src/main/webapp/WEB-INF/web.xml
index 872154064a..671813ac90 100644
--- a/spring-mvc-xml/src/main/webapp/WEB-INF/web.xml
+++ b/spring-mvc-xml/src/main/webapp/WEB-INF/web.xml
@@ -1,48 +1,45 @@
-
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
- Spring MVC XML Application
+ Spring MVC XML Application
-
-
- contextClass
-
+
+
+ contextClass
+
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
-
-
- contextConfigLocation
- org.baeldung.spring
-
+
+
+ contextConfigLocation
+ org.baeldung.spring
+
-
- org.springframework.web.context.ContextLoaderListener
-
+
+ org.springframework.web.context.ContextLoaderListener
+
-
-
- mvc
- org.springframework.web.servlet.DispatcherServlet
- 1
-
-
- mvc
- /
-
+
+
+ mvc
+ org.springframework.web.servlet.DispatcherServlet
+ 1
+
+
+ mvc
+ /
+
-
+
-
- 10
-
-
-
- index.html
-
+
+ 10
+
+
+ index.html
+
\ No newline at end of file
diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/SessionListenerWithMetrics.java b/spring-security-mvc-custom/src/main/java/org/baeldung/web/SessionListenerWithMetrics.java
new file mode 100644
index 0000000000..7119b7023e
--- /dev/null
+++ b/spring-security-mvc-custom/src/main/java/org/baeldung/web/SessionListenerWithMetrics.java
@@ -0,0 +1,32 @@
+package org.baeldung.web;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+public class SessionListenerWithMetrics implements HttpSessionListener {
+
+ private static int totalActiveSessions;
+
+ public SessionListenerWithMetrics() {
+ super();
+ }
+
+ // API
+
+ public static int getTotalActiveSession() {
+ return totalActiveSessions;
+ }
+
+ @Override
+ public void sessionCreated(final HttpSessionEvent arg0) {
+ totalActiveSessions++;
+ System.out.println("sessionCreated - add one session into counter");
+ }
+
+ @Override
+ public void sessionDestroyed(final HttpSessionEvent arg0) {
+ totalActiveSessions--;
+ System.out.println("sessionDestroyed - deduct one session from counter");
+ }
+
+}
\ No newline at end of file
diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml b/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml
index 73216e669f..bf691dc491 100644
--- a/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml
+++ b/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml
@@ -1,56 +1,57 @@
-
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
- Spring MVC Custom Application
+ Spring MVC Custom Application
-
- 1
-
-
-
-
- contextClass
-
- org.springframework.web.context.support.AnnotationConfigWebApplicationContext
-
-
-
- contextConfigLocation
- org.baeldung.spring
-
+
+ 1
+
+
+ org.baeldung.web.SessionListenerWithMetrics
+
-
- org.springframework.web.context.ContextLoaderListener
-
+
+
+ contextClass
+
+ org.springframework.web.context.support.AnnotationConfigWebApplicationContext
+
+
+
+ contextConfigLocation
+ org.baeldung.spring
+
-
-
- mvc
- org.springframework.web.servlet.DispatcherServlet
- 1
-
-
- mvc
- /
-
+
+ org.springframework.web.context.ContextLoaderListener
+
-
-
- springSecurityFilterChain
- org.springframework.web.filter.DelegatingFilterProxy
-
-
- springSecurityFilterChain
- /*
-
+
+
+ mvc
+ org.springframework.web.servlet.DispatcherServlet
+ 1
+
+
+ mvc
+ /
+
-
-
-
+
+
+ springSecurityFilterChain
+ org.springframework.web.filter.DelegatingFilterProxy
+
+
+ springSecurityFilterChain
+ /*
+
+
+
+
+
\ No newline at end of file