struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Theme problem after update to 2.3.16 -- loading parent theme templates?
Date Wed, 11 Dec 2013 21:28:58 GMT
With 2.3.16 a proper theme inheritance mechanism was introduced - you
don't have copy the whole theme to extend it, just override file you
need, the rest will be loaded from parent theme and parent and so on.

The docs were updated to include information about 'expandTheme'
variable which should be used when you want to use that mechanism
inside your custom template.

http://struts.apache.org/release/2.3.x/docs/extending-themes.html
https://issues.apache.org/jira/browse/WW-4145


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/12/11 rgm <struts@rgm.nu>:
> I'm getting this error from my JBoss 7 application server:
>
> ERROR [freemarker.runtime] (http--0.0.0.0-8443-3) Template processing
> error: "Error reading included file
> /mx/themes/~~~rgm/dynamic-attributes.ftl": freemarker.temp
> late.TemplateException: Error reading included file
> /mx/themes/~~~rgm/dynamic-attributes.ftl
>         at freemarker.core.Include.accept(Include.java:167)
> [freemarker.jar:2.3.19]
>         at freemarker.core.Environment.visit(Environment.java:221)
> [freemarker.jar:2.3.19]
> ---snip---
>
> I have a theme called "rgm" in a directory called mx/themes:
>
> $ ls -1d mx/themes/*
> mx/themes/archive
> mx/themes/css_xhtml
> mx/themes/html5
> mx/themes/rgm
> mx/themes/simple
> mx/themes/xhtml
>
> I've updated my copies of xhtml, css_xhtml, and simple themes from here:
> ./struts-2.3.16/src/core/src/main/resources/template/*
>
> My "rgm" theme has a theme.properties file with "parent = css_xhtml", which
> itself uses parent = xhtml, which itself uses parent = simple.
>
> The "rgm" theme does not include dynamic-attributes.ftl, but the "parent"
> chain back to "simple" does.  I was under the impression that because I had
> a "theme.properties" declaring a parent that I didn't need to include every
> file in my theme?  I've read "Extending Themes" document carefully.  I had
> no trouble when using Struts 2.3.15.3.
>
> My struts.xml has these constants:
>     <constant name="struts.ui.templateDir" value="mx/themes"></constant>
>     <constant name="struts.ui.theme" value="rgm"></constant>
>
> Has anyone else successfully extended a theme using Struts 2.3.16 on JBoss
> 7?  What am I missing?
>
> Sincerely,
> rgm

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message