From: David ‘Bombe’ Roden Date: Thu, 26 Apr 2012 13:41:04 +0000 (+0200) Subject: Perform certain processing in all pages. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=158a68df403a8018a83f5284c1f3067c3aec9b3a;p=demoscenemusic.git Perform certain processing in all pages. --- 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")); + } + }