struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <>
Subject [jira] [Commented] (WW-4335) Error while extending a theme if located in a deep hierarchy
Date Tue, 05 Aug 2014 11:49:12 GMT


Hudson commented on WW-4335:

SUCCESS: Integrated in Struts-JDK6-develop #71 (See [])
WW-4335 Uses lastIndexOf to figure out theme name (lukaszlenart: rev 16e240b4a534620c601d18ad7ff290806584d47e)
* core/src/test/java/org/apache/struts2/views/freemarker/
* core/src/main/java/org/apache/struts2/views/freemarker/

> Error while extending a theme if located in a deep hierarchy
> ------------------------------------------------------------
>                 Key: WW-4335
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.3.16,,
>         Environment: Windows Vista, Java 7, Tomcat 7
>            Reporter: recyclebin5385
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 2.3.18
>         Attachments:
> 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 in "/themes/foo/bar", whose content is like
>     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 <s:textfield> tag.
> It worked with Struts, 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

View raw message