Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97E921090D for ; Thu, 1 Aug 2013 11:05:51 +0000 (UTC) Received: (qmail 86746 invoked by uid 500); 1 Aug 2013 11:05:50 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 86695 invoked by uid 500); 1 Aug 2013 11:05:50 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 86610 invoked by uid 99); 1 Aug 2013 11:05:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 11:05:49 +0000 Date: Thu, 1 Aug 2013 11:05:49 +0000 (UTC) From: "Jasper Rosenberg (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4145) file.ftl in xhtml theme directly references xhtml controlfooter.ftl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726335#comment-13726335 ] Jasper Rosenberg commented on WW-4145: -------------------------------------- Thanks :) That is where I started, but I ended up with it in the FreemakerTemplateEngine for 2 reasons: 1. The FreemarkerManager package had no theme/tag awareness that I could see, so it seemed odd to make it less generic. We would have to inject the FreemakerTemplateEngine into the manager to pass to the FreemarkerThemeTemplateLoader, or use the container to construct the FreemarkerThemeTemplateLoader and have it injected that way (along with the uiThemeExpansionToken). 2. If a subclass of FreemarkerManager needs to replace the config template loader (which I do periodically when dynamically changing A/B tests), it is more fragile because the subclass needs to know to put the FreemarkerThemeTemplateLoader back on top. We could probably make that clearer with some documentation and explicit hooks for that case though. I do think there are some strong advantages to your suggestion, namely that we wouldn't need the synchronized block, which technically isn't sufficient anyway since it doesn't keep someone else in another thread from setting the template loader while you are in the synch block. I will create an alternate patch with this approach and you can decide which you prefer. > file.ftl in xhtml theme directly references xhtml controlfooter.ftl > ------------------------------------------------------------------- > > Key: WW-4145 > URL: https://issues.apache.org/jira/browse/WW-4145 > Project: Struts 2 > Issue Type: Bug > Components: Other > Affects Versions: 2.3.15.1 > Reporter: Jasper Rosenberg > Assignee: Lukasz Lenart > Labels: freemarker, tags, xhtml > Fix For: 2.3.16 > > Attachments: ThemeExpansion.patch > > > Should use $\{parameters.theme} instead so can be used in theme extension. > {code} > <#include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" /> > <#include "/${parameters.templateDir}/simple/file.ftl" /> > <#include "/${parameters.templateDir}/${parameters.theme}/controlfooter.ftl" /> > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira