Re: Unable to Find FreeMarker Template in Struts 2.3.16.2

2014-05-02 Thread bphill...@ku.edu
John:

   You may want to use git clone to get our updated Struts 2 example
projects:  git clone http://git.apache.org/struts-examples.git 

   In the example projects is one for Struts 2 Themes that shows how the
customized .ftl files are under src/main/resources (in specific folders) and
also the addition of a theme.properties file.

   There is also an updated tutorial on Struts 2 custom themes: 
http://struts.apache.org/release/2.3.x/docs/struts-2-themes.html

Hope this helps you.

Bruce



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Unable-to-Find-FreeMarker-Template-in-Struts-2-3-16-2-tp5715856p5715869.html
Sent from the Struts - User mailing list archive at Nabble.com.

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



Re: Unable to Find FreeMarker Template in Struts 2.3.16.2

2014-05-02 Thread Lukasz Lenart
This is issue is already solved in upcoming 2.3.18 version [1], the
simplest solution is to move template folder to be on classpath not
under webapp folder, if you use Maven then move template folder from
src/main/webapp to src/main/resources

[1] https://issues.apache.org/jira/browse/WW-4260


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

2014-05-01 20:37 GMT+02:00 John Boyer :
> Hello:
>
> I've upgraded from Struts 2.3.4.1 to Struts 2.3.16.2. I've been using the 
> KUTheme to render a vertical checkbox list as outlined in 2.2x docs at 
> http://goo.gl/vHqXBH. However, now the framework is unable to find KUTheme 
> template in Struts 2.3.16.2. It's located in default location at 
> `template/KUTheme`, but I get the following FreeMarker template error:
>
> ~~
> Error reading included file template/~~~KUTheme/controlheader-core.ftl
> The problematic instruction:
> --
> ==> include 
> "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" 
> [on line 23, column 1 in template/xhtml/controlheader.ftl]
>  in include "/${parameters.templateDir}/xhtml/controlheader.ftl" [on line 1, 
> column 1 in template/KUTheme/checkboxlist.ftl]
> --
>
> Java backtrace for programmers:
> --
> freemarker.template.TemplateException: Error reading included file 
> template/~~~KUTheme/controlheader-core.ftl
> ...
> ~~
>
> Does anyone know to fix this problem?
>
> I've included the theme's file content below, if that helps.
>
> Thank you for your time in advance.
>
> Regards,
>
> John Boyer
>
>
> <
> KUTheme Files
>
> 
> <#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
> <#include "/${parameters.templateDir}/KUTheme_simple/checkboxlist.ftl" />
> <#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" /><#nt/>
>
>
> 
> <#assign itemCount = 0/>
> <#if parameters.list??>
> <@s.iterator value="parameters.list">
> <#assign itemCount = itemCount + 1/>
> <#if parameters.listKey??>
> <#assign itemKey = stack.findValue(parameters.listKey)/>
> <#else>
> <#assign itemKey = stack.findValue('top')/>
> 
> <#if parameters.listValue??>
> <#assign itemValue = 
> stack.findString(parameters.listValue)?default("")/>
> <#else>
> <#assign itemValue = stack.findString('top')/>
> 
> <#assign itemKeyStr=itemKey.toString() />
>  value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
> <#if tag.contains(parameters.nameValue, itemKey)>
>  checked="checked"<#rt/>
> 
> <#if parameters.disabled?default(false)>
>  disabled="disabled"<#rt/>
> 
> <#if parameters.title??>
>  title="${parameters.title?html}"<#rt/>
> 
> <#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
> <#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
> />
>  style="font-weight:normal">${itemValue?html} 
> 
> <#else>
>    
> 
>  name="__multiselect_${parameters.name?html}" value=""<#rt/>
> <#if parameters.disabled?default(false)>
>  disabled="disabled"<#rt/>
> 
>  />
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

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



Unable to Find FreeMarker Template in Struts 2.3.16.2

2014-05-01 Thread John Boyer
Hello:

I've upgraded from Struts 2.3.4.1 to Struts 2.3.16.2. I've been using the 
KUTheme to render a vertical checkbox list as outlined in 2.2x docs at 
http://goo.gl/vHqXBH. However, now the framework is unable to find KUTheme 
template in Struts 2.3.16.2. It's located in default location at 
`template/KUTheme`, but I get the following FreeMarker template error:

~~
Error reading included file template/~~~KUTheme/controlheader-core.ftl
The problematic instruction:
--
==> include 
"/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" 
[on line 23, column 1 in template/xhtml/controlheader.ftl]
 in include "/${parameters.templateDir}/xhtml/controlheader.ftl" [on line 1, 
column 1 in template/KUTheme/checkboxlist.ftl]
--

Java backtrace for programmers:
--
freemarker.template.TemplateException: Error reading included file 
template/~~~KUTheme/controlheader-core.ftl
...
~~

Does anyone know to fix this problem? 

I've included the theme's file content below, if that helps.

Thank you for your time in advance.

Regards,

John Boyer


<
KUTheme Files


<#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
<#include "/${parameters.templateDir}/KUTheme_simple/checkboxlist.ftl" />
<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" /><#nt/>



<#assign itemCount = 0/>
<#if parameters.list??>
<@s.iterator value="parameters.list">
<#assign itemCount = itemCount + 1/>
<#if parameters.listKey??>
<#assign itemKey = stack.findValue(parameters.listKey)/>
<#else>
<#assign itemKey = stack.findValue('top')/>

<#if parameters.listValue??>
<#assign itemValue = 
stack.findString(parameters.listValue)?default("")/>
<#else>
<#assign itemValue = stack.findString('top')/>

<#assign itemKeyStr=itemKey.toString() />

<#if tag.contains(parameters.nameValue, itemKey)>
 checked="checked"<#rt/>

<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>

<#if parameters.title??>
 title="${parameters.title?html}"<#rt/>

<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
/>
${itemValue?html} 

<#else>
   


<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>

 />


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