[ 
https://issues.apache.org/jira/browse/WW-5211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alireza Fattahi updated WW-5211:
--------------------------------
    Description: 
We have upgraded from `Struts 2.5.30` to `Struts 6.0.0`. The project `Struts 2 
jquery plugin version 4.0.3`. 
When loading a page we face this error:
{code:java}
    Could not load the FreeMarker template named 'div':
    Attempted: /template/jquery/div.ftl
    Attempted: /template/xhtml/div.ftl
    Attempted: /template/simple/div.ftl
    The TemplateLoader provided by the FreeMarker Configuration was a: 
org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader
    Could not open template{code}
The stack trace cause is:

 
{code:java}
    Caused by: freemarker.core.ParseException: Syntax error in template 
"template/jquery/div.ftl" in line 22, column 43:
    Using ?html (legacy escaping) is not allowed when auto-escaping is on with 
a markup output format (HTML), to avoid double-escaping mistakes.
        at freemarker.core.FMParser.BuiltIn(FMParser.java:1225)
        at freemarker.core.FMParser.PrimaryExpression(FMParser.java:595)
        at freemarker.core.FMParser.UnaryExpression(FMParser.java:707)
        at freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:822)
 
{code}
The line 22 in file `template/jquery/div.ftl` is as:

   
{code:java}
 <#if parameters.id??> id="${parameters.id?html}"<#rt/></#if>{code}
I am not familiar with `Freemaker` and I hope I could find a flag or something 
to by pass this.

I see the migration guide at 
[https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+6.0.0+migration|http://example.com/]
 and also 
h[ttps://struts.apache.org/tag-developers/tag-syntax#escaping-body-of-a-tag|http://example.com/]
 but could not find the issue

I try to set `struts.ui.escapeHtmlBody` this in `struts.xml` but it did not 
help.

I find the the freemaker version in both `Struts 2.5.30` and `Struts 6.0.0` is 
`Freemaker 2.3.31`. 

also try to set freemaker.propeties with
{code:java}
auto_escaping_policy=disabled{code}
 

but it did no help

  was:
We have upgraded to `Struts 6.0.0`. The project `Struts 2 jquery plugin version 
4.0.3`. 
When loading a page we face this error:
{code:java}
    Could not load the FreeMarker template named 'div':
    Attempted: /template/jquery/div.ftl
    Attempted: /template/xhtml/div.ftl
    Attempted: /template/simple/div.ftl
    The TemplateLoader provided by the FreeMarker Configuration was a: 
org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader
    Could not open template{code}

The stack trace cause is:

 
{code:java}
    Caused by: freemarker.core.ParseException: Syntax error in template 
"template/jquery/div.ftl" in line 22, column 43:
    Using ?html (legacy escaping) is not allowed when auto-escaping is on with 
a markup output format (HTML), to avoid double-escaping mistakes.
        at freemarker.core.FMParser.BuiltIn(FMParser.java:1225)
        at freemarker.core.FMParser.PrimaryExpression(FMParser.java:595)
        at freemarker.core.FMParser.UnaryExpression(FMParser.java:707)
        at freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:822)
 
{code}

The line 22 in file `template/jquery/div.ftl` is as:

   
{code:java}
 <#if parameters.id??> id="${parameters.id?html}"<#rt/></#if>{code}
I am not familiar with `Freemaker` and I hope I could find a flag or something 
to by pass this.

I see the migration guide at 
[https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+6.0.0+migration|http://example.com]
 and also 
h[ttps://struts.apache.org/tag-developers/tag-syntax#escaping-body-of-a-tag|http://example.com]
 but could not find the issue

I try to set `struts.ui.escapeHtmlBody` this in `struts.xml` but it did not 
help.

 

also try to set freemaker.propeties with
{code:java}
auto_escaping_policy=disabled{code}
 

but it did no help


> Error while upgrade to Struts 6 with struts jquery plugin
> ---------------------------------------------------------
>
>                 Key: WW-5211
>                 URL: https://issues.apache.org/jira/browse/WW-5211
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 6.0.0
>            Reporter: Alireza Fattahi
>            Priority: Major
>
> We have upgraded from `Struts 2.5.30` to `Struts 6.0.0`. The project `Struts 
> 2 jquery plugin version 4.0.3`. 
> When loading a page we face this error:
> {code:java}
>     Could not load the FreeMarker template named 'div':
>     Attempted: /template/jquery/div.ftl
>     Attempted: /template/xhtml/div.ftl
>     Attempted: /template/simple/div.ftl
>     The TemplateLoader provided by the FreeMarker Configuration was a: 
> org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader
>     Could not open template{code}
> The stack trace cause is:
>  
> {code:java}
>     Caused by: freemarker.core.ParseException: Syntax error in template 
> "template/jquery/div.ftl" in line 22, column 43:
>     Using ?html (legacy escaping) is not allowed when auto-escaping is on 
> with a markup output format (HTML), to avoid double-escaping mistakes.
>         at freemarker.core.FMParser.BuiltIn(FMParser.java:1225)
>         at freemarker.core.FMParser.PrimaryExpression(FMParser.java:595)
>         at freemarker.core.FMParser.UnaryExpression(FMParser.java:707)
>         at 
> freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:822)
>  
> {code}
> The line 22 in file `template/jquery/div.ftl` is as:
>    
> {code:java}
>  <#if parameters.id??> id="${parameters.id?html}"<#rt/></#if>{code}
> I am not familiar with `Freemaker` and I hope I could find a flag or 
> something to by pass this.
> I see the migration guide at 
> [https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+6.0.0+migration|http://example.com/]
>  and also 
> h[ttps://struts.apache.org/tag-developers/tag-syntax#escaping-body-of-a-tag|http://example.com/]
>  but could not find the issue
> I try to set `struts.ui.escapeHtmlBody` this in `struts.xml` but it did not 
> help.
> I find the the freemaker version in both `Struts 2.5.30` and `Struts 6.0.0` 
> is `Freemaker 2.3.31`. 
> also try to set freemaker.propeties with
> {code:java}
> auto_escaping_policy=disabled{code}
>  
> but it did no help



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to