Index: webapps/examples/WEB-INF/web.xml
===================================================================
--- webapps/examples/WEB-INF/web.xml (revision 1071129)
+++ webapps/examples/WEB-INF/web.xml (working copy)
@@ -105,6 +105,9 @@
listeners.SessionListener
+
+ listeners.RequestListener
+
Index: webapps/examples/WEB-INF/classes/listeners/RequestListener.java
===================================================================
--- webapps/examples/WEB-INF/classes/listeners/RequestListener.java (revision 0)
+++ webapps/examples/WEB-INF/classes/listeners/RequestListener.java (revision 0)
@@ -0,0 +1,45 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package listeners;
+
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Example listener for request related events.
+ * This implementation just logs the URI and dispatch type
+ */
+public class RequestListener implements ServletRequestListener {
+ Log log = LogFactory.getLog(RequestListener.class);
+
+
+ @Override
+ public void requestInitialized(ServletRequestEvent sre) {
+ HttpServletRequest request = (HttpServletRequest) sre.getServletRequest();
+ log.info("Request initialized, path = " + request.getRequestURI() + " type = " + request.getDispatcherType());
+ }
+
+ @Override
+ public void requestDestroyed(ServletRequestEvent sre) {
+ HttpServletRequest request = (HttpServletRequest) sre.getServletRequest();
+ log.info("Request destroyed, path = " + request.getRequestURI() + " type = " + request.getDispatcherType());
+ }
+}