struts-community-plugins / struts2-jquery

Struts2 jQuery Plugin
Apache License 2.0
82 stars 50 forks source link

Upgrade to Struts 6 and all tags failed to load #301

Closed afattahi54 closed 2 years ago

afattahi54 commented 2 years ago

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:

    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

The stack trace cause is:

    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)

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

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

This issue happens in approximately all tags.

sdutry commented 2 years ago

We are currently working on a new release of the plugin which is compatible with verions 6.x.x of struts.

We are fixing some bugs that have come up and are nearing a stage where we can release the version.

jogep commented 2 years ago

Version 5.0.0 with support for Struts2 6.0.0 and fix included is released.