From e1c691c0f78473f4023f4e9dc71d34d4c7199e13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 25 Jul 2012 21:06:51 +0200 Subject: [PATCH] =?utf8?q?When=20an=20empty=20file=20is=20requested,=20use?= =?utf8?q?=20page=20named=20=E2=80=9Cindex.=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.7.4