From 3fd7f463f72b918f175f68ec15cd0d4362657316 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Fri, 1 Mar 2024 12:41:08 -0800 Subject: [PATCH] Support loading web servlet resources from src/js directory --- .../server/net/web/WebServletForStaticContent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/marauroa/server/net/web/WebServletForStaticContent.java b/src/marauroa/server/net/web/WebServletForStaticContent.java index 837c6d5c..fb3e36fb 100644 --- a/src/marauroa/server/net/web/WebServletForStaticContent.java +++ b/src/marauroa/server/net/web/WebServletForStaticContent.java @@ -1,5 +1,5 @@ /*************************************************************************** - * (C) Copyright 2010-2023 - Marauroa * + * (C) Copyright 2010-2024 - Marauroa * *************************************************************************** *************************************************************************** * * @@ -117,6 +117,9 @@ private void sendFile(HttpServletRequest request, HttpServletResponse response, if (name.startsWith("/srcjs/")) { name = name.substring(6); } + if (name.startsWith("/src/js/")) { + name = name.substring(7); + } if (name.startsWith("/build/js/")) { name = name.substring(9); } @@ -128,6 +131,9 @@ private void sendFile(HttpServletRequest request, HttpServletResponse response, if (is == null) { is = WebServletForStaticContent.class.getClassLoader().getResourceAsStream("srcjs" + name); } + if (is == null) { + is = WebServletForStaticContent.class.getClassLoader().getResourceAsStream("src/js" + name); + } if (is == null) { is = DebugInterface.get().onFileRequest(request, response, name); }