From 828ffa35841a585ddeeac9d934e3a4951e1702c0 Mon Sep 17 00:00:00 2001 From: ulrich Date: Mon, 28 Dec 2020 09:53:39 +0000 Subject: [PATCH] Von DefaultServlet auf HttpServlet umgestellt --- src/de/uhilger/wbx/web/TNServlet.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/uhilger/wbx/web/TNServlet.java b/src/de/uhilger/wbx/web/TNServlet.java index 9e58fa2..48a6703 100644 --- a/src/de/uhilger/wbx/web/TNServlet.java +++ b/src/de/uhilger/wbx/web/TNServlet.java @@ -23,10 +23,10 @@ import java.net.URLDecoder; import java.util.logging.Logger; import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.coobird.thumbnailator.Thumbnails; -import org.apache.catalina.servlets.DefaultServlet; /** * Mit dem TNServlet kann für eine Bilddatei eine @@ -36,7 +36,7 @@ * Unterstuetzt werden die Varianten * 120 (_tn), 240 (_kl), 500 (_dd), 700 (_mt), 1200 (_gr) */ -public class TNServlet extends DefaultServlet { +public class TNServlet extends HttpServlet { private static final Logger logger = Logger.getLogger(TNServlet.class.getName()); @@ -93,7 +93,7 @@ // --- Logausgabe Ende if(uriStr.endsWith(JPG) || uriStr.endsWith(JPEG) || uriStr.endsWith(PNG)) { - File dir = new File(request.getServletContext().getRealPath("/")); + File dir = new File(request.getSession().getServletContext().getRealPath("/")); String suburiStr = uriStr.substring(request.getContextPath().length()); File imgfile = new File(dir, suburiStr); if(uriStr.contains(TN)) { -- Gitblit v1.9.3