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 7D9C81091C for ; Tue, 5 Aug 2014 07:39:12 +0000 (UTC) Received: (qmail 75727 invoked by uid 500); 5 Aug 2014 07:39:12 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 75691 invoked by uid 500); 5 Aug 2014 07:39:12 -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 75681 invoked by uid 99); 5 Aug 2014 07:39:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2014 07:39:12 +0000 Date: Tue, 5 Aug 2014 07:39:12 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (WW-4335) Error while extending a theme if located in a deep hierarchy 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-4335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart resolved WW-4335. ------------------------------- Resolution: Fixed Assignee: Lukasz Lenart Replaces {{indexOf}} with {{lastIndexOf}} and should be ok, can you test? > Error while extending a theme if located in a deep hierarchy > ------------------------------------------------------------ > > Key: WW-4335 > URL: https://issues.apache.org/jira/browse/WW-4335 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.3.16, 2.3.16.1, 2.3.16.2 > Environment: Windows Vista, Java 7, Tomcat 7 > Reporter: recyclebin5385 > Assignee: Lukasz Lenart > Priority: Minor > Fix For: 2.3.18 > > Attachments: ww4335test.zip > > > When I create a theme named "foo/bar" which extends the default theme "simple" and use the theme in a JSP file, an error saying "Error reading included file template/~~~foo/bar/css.ftl" occurs and the web page cannot be rendered. > How to reproduce: > 1. Create a theme folder "/themes/foo/bar" in a resource folder. > The point is there are more than two folders nested under /themes. > 2. Create a property file theme.properties in "/themes/foo/bar", whose content is like below. > parent = simple > 3. In struts.xml, set constant "struts.ui.theme" as "foo/bar". > 4. Access to any pages in the web application which contains a tag. > It worked with Struts 2.3.15.3, but no longer works with Struts 2.3.16. > New tag templates in Struts 2.3.16 contains codes like {{/$\{parameters.templateDir\}/$\{parameters.expandTheme\}/css.ftl}}. > If the name of the theme is "foo/bar", this code is translated into {{template/~~~foo/bar/css.ftl}}. > The translated string is passed to method {{org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader#findTemplateSource(String)}} > But this method cannot handle a theme name containing a slash like "foo/bar". > I am not sure whether such a theme is permitted or not by the Struts 2 specification, so I reported it as a bug. > A workaround is not to create such a theme when creating a new web application, but if an existing one already uses a theme like this, it will be affected. > Another workaround is to replace the original FreemarkerThemeTemplateLoader with a fixed one, but it is a little bit too complicated. -- This message was sent by Atlassian JIRA (v6.2#6252)