When an empty file is requested, use page named “index.”
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 25 Jul 2012 19:06:51 +0000 (21:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jul 2012 05:28:48 +0000 (07:28 +0200)
src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java

index 9b09108..cfef6dd 100644 (file)
@@ -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<ServletRequest> page = pages.get(path);
                if (page != null) {
                        ServletRequest servletRequest;