From d1c308f118bfbeddfc469a2610017ffb3d935595 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Mon, 2 Dec 2019 14:12:23 +0000 Subject: [PATCH] access mwClient from the application context --- webui/src/main/java/com/muwire/webui/MuWireServlet.java | 1 - webui/src/main/webapp/Downloads.jsp | 2 +- webui/src/main/webapp/Home.jsp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webui/src/main/java/com/muwire/webui/MuWireServlet.java b/webui/src/main/java/com/muwire/webui/MuWireServlet.java index c890efd1..152f0585 100644 --- a/webui/src/main/java/com/muwire/webui/MuWireServlet.java +++ b/webui/src/main/java/com/muwire/webui/MuWireServlet.java @@ -45,7 +45,6 @@ public class MuWireServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - req.getSession().setAttribute("mwClient", client); if (client.needsMWInit()) { resp.sendRedirect("/MuWire/MuWire.jsp"); } else { diff --git a/webui/src/main/webapp/Downloads.jsp b/webui/src/main/webapp/Downloads.jsp index f1fa482d..a670854f 100644 --- a/webui/src/main/webapp/Downloads.jsp +++ b/webui/src/main/webapp/Downloads.jsp @@ -10,7 +10,7 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <% - MuWireClient client = (MuWireClient) session.getAttribute("mwClient"); + MuWireClient client = (MuWireClient) application.getAttribute("mwClient"); ConnectionCounter connectionCounter = (ConnectionCounter) client.getServletContext().getAttribute("connectionCounter"); %> diff --git a/webui/src/main/webapp/Home.jsp b/webui/src/main/webapp/Home.jsp index 91e14866..98391b93 100644 --- a/webui/src/main/webapp/Home.jsp +++ b/webui/src/main/webapp/Home.jsp @@ -10,7 +10,7 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <% - MuWireClient client = (MuWireClient) session.getAttribute("mwClient"); + MuWireClient client = (MuWireClient) application.getAttribute("mwClient"); ConnectionCounter connectionCounter = (ConnectionCounter) client.getServletContext().getAttribute("connectionCounter"); String persona = client.getCore().getMe().getHumanReadableName();