From 1b616c89a6518af37a55f35123e2252658fa56b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 28 Jul 2012 01:37:19 +0200 Subject: [PATCH] Add match filter to templates. --- .../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 df753f1..a159e8a 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/core/TemplateServlet.java @@ -52,6 +52,7 @@ import net.pterodactylus.util.io.StreamCopier; import net.pterodactylus.util.template.ClassPathTemplateProvider; import net.pterodactylus.util.template.CollectionSortFilter; import net.pterodactylus.util.template.HtmlFilter; +import net.pterodactylus.util.template.MatchFilter; import net.pterodactylus.util.template.ReflectionAccessor; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContextFactory; @@ -68,6 +69,7 @@ import net.pterodactylus.util.web.Response; public class TemplateServlet extends HttpServlet { private Core core; + private final TemplateContextFactory templateContextFactory = new TemplateContextFactory(); private final Map> pages = new HashMap>(); @@ -116,6 +118,7 @@ public class TemplateServlet extends HttpServlet { }); templateContextFactory.addFilter("sort", sortFilter); + templateContextFactory.addFilter("matches", new MatchFilter()); templateContextFactory.addTemplateObject("core", core); templateContextFactory.addTemplateObject("dataManager", core.getDataManager()); -- 2.7.4