You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/12/11 04:51:34 UTC
cvs commit: jakarta-tomcat-4.0/tester/src/tester/org/apache/tester Session04.java SessionListener01.java
craigmcc 01/12/10 19:51:34
Modified: tester/src/tester/org/apache/tester Session04.java
SessionListener01.java
Log:
Enhance logging of session creation and destroy events, to ensure that the
right events are called when you invalidate an old session, and create a
new one, within the same servlet request. No functional change.
Revision Changes Path
1.2 +4 -1 jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/Session04.java
Index: Session04.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/Session04.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Session04.java 2001/04/11 04:31:08 1.1
+++ Session04.java 2001/12/11 03:51:34 1.2
@@ -69,7 +69,7 @@
* identifier) while processing this request.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/04/11 04:31:08 $
+ * @version $Revision: 1.2 $ $Date: 2001/12/11 03:51:34 $
*/
public class Session04 extends HttpServlet {
@@ -77,6 +77,8 @@
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
+ log("Session04 - Starting, requestedSessionId = " +
+ request.getRequestedSessionId());
response.setContentType("text/plain");
PrintWriter writer = response.getWriter();
@@ -184,6 +186,7 @@
writer.println(message);
}
StaticLogger.reset();
+ log("Session04 - Stopping");
}
1.2 +9 -2 jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/SessionListener01.java
Index: SessionListener01.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/SessionListener01.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SessionListener01.java 2001/04/18 19:53:09 1.1
+++ SessionListener01.java 2001/12/11 03:51:34 1.2
@@ -64,10 +64,11 @@
/**
* Application event listener for session events. All events that occur
- * are logged appropriately to the static logger.
+ * are logged appropriately to the static logger. In addition, session
+ * creation and destruction events are logged to the servlet context log.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/04/18 19:53:09 $
+ * @version $Revision: 1.2 $ $Date: 2001/12/11 03:51:34 $
*/
public class SessionListener01
@@ -91,10 +92,16 @@
public void sessionCreated(HttpSessionEvent event) {
StaticLogger.write("SessionListener01: sessionCreated()");
+ HttpSession session = event.getSession();
+ session.getServletContext().log("SessionListener01: sessionCreated(" +
+ session.getId() + ")");
}
public void sessionDestroyed(HttpSessionEvent event) {
StaticLogger.write("SessionListener01: sessionDestroyed()");
+ HttpSession session = event.getSession();
+ session.getServletContext().log("SessionListener01: sessionDestroyed("
+ + session.getId() + ")");
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>