From: David ‘Bombe’ Roden Date: Wed, 25 Jul 2012 19:06:51 +0000 (+0200) Subject: When an empty file is requested, use page named “index.” X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e1c691c0f78473f4023f4e9dc71d34d4c7199e13;p=demoscenemusic.git When an empty file is requested, use page named “index.” --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java b/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java index 9b09108..cfef6dd 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java @@ -153,6 +153,9 @@ public class TemplateServlet extends HttpServlet { if (path.startsWith("/")) { path = path.substring(1); } + if ((path.length() == 0) || (path.endsWith("/"))) { + path += "index"; + } Page page = pages.get(path); if (page != null) { ServletRequest servletRequest;