From 158a68df403a8018a83f5284c1f3067c3aec9b3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 26 Apr 2012 15:41:04 +0200 Subject: [PATCH] Perform certain processing in all pages. --- .../java/net/pterodactylus/demoscenemusic/page/BasePage.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/page/BasePage.java b/src/main/java/net/pterodactylus/demoscenemusic/page/BasePage.java index 5990c4f..88f5fc7 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/page/BasePage.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/page/BasePage.java @@ -19,7 +19,9 @@ package net.pterodactylus.demoscenemusic.page; import net.pterodactylus.demoscenemusic.core.Core; import net.pterodactylus.util.template.Template; +import net.pterodactylus.util.template.TemplateContext; import net.pterodactylus.util.template.TemplateContextFactory; +import net.pterodactylus.util.web.RedirectException; import net.pterodactylus.util.web.TemplatePage; /** @@ -49,4 +51,13 @@ public class BasePage extends TemplatePage { return core; } + /** + * {@inheritDoc} + */ + @Override + protected void processTemplate(TemplateContext templateContext, ServletRequest request) throws RedirectException { + super.processTemplate(templateContext, request); + templateContext.set("currentUser", request.getServletRequest().getAttribute("currentUser")); + } + } -- 2.7.4