From 15c9f0bfc2c5ff03ec84c16b90df028a09520c82 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 27 Nov 2019 05:51:39 -0600 Subject: [PATCH] Issue #4329 - Cleaning up SessionDump Signed-off-by: Joakim Erdfelt --- .../src/main/java/com/acme/SessionDump.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SessionDump.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SessionDump.java index 8cc74ab0d60..ed06dc812bd 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SessionDump.java +++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SessionDump.java @@ -41,7 +41,7 @@ public class SessionDump extends HttpServlet /** * Simple object attribute to test serialization */ - public class ObjectAttributeValue implements java.io.Serializable + public static class ObjectAttributeValue implements java.io.Serializable { long l; @@ -58,8 +58,6 @@ public class SessionDump extends HttpServlet int redirectCount = 0; - String pageType; - @Override public void init(ServletConfig config) throws ServletException @@ -67,8 +65,7 @@ public class SessionDump extends HttpServlet super.init(config); } - protected void handleForm(HttpServletRequest request, - HttpServletResponse response) + protected void handleForm(HttpServletRequest request) { HttpSession session = request.getSession(false); String action = request.getParameter("Action"); @@ -99,9 +96,9 @@ public class SessionDump extends HttpServlet @Override public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException + throws IOException { - handleForm(request, response); + handleForm(request); String nextUrl = getURI(request) + "?R=" + redirectCount++; String encodedUrl = response.encodeRedirectURL(nextUrl); response.sendRedirect(encodedUrl); @@ -110,9 +107,9 @@ public class SessionDump extends HttpServlet @Override public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException + throws IOException { - handleForm(request, response); + handleForm(request); response.setContentType("text/html"); @@ -124,7 +121,7 @@ public class SessionDump extends HttpServlet } catch (IllegalStateException e) { - e.printStackTrace(System.err); + log("Session already invalidated", e); session = null; }