Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5163

Error executing FreeMarker template

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.27, 2.5.28
    • 2.5.29, 6.0.0
    • Core
    • None

    Description

      Since struts2-core version 2.5.27 we are unable to access our web application.

      This is part of the error log:

      12 Jan. 2022 09:23:22 DEBUG [qtp1918833478-32] org.apache.struts2.components.UIBean:577 - Rendering template /template/jquery/head
      12 Jan. 2022 09:23:22 DEBUG [qtp1918833478-32] o.a.s.c.t.FreemarkerTemplateEngine:119 - Rendering template: /template/jquery/head.ftl
      12 Jan. 2022 09:23:22 DEBUG [qtp1918833478-32] o.a.s.c.t.FreemarkerTemplateEngine:151 - Puts action on the top of ValueStack, just before the tag
      12 Jan. 2022 09:23:22 ERROR [qtp1918833478-32] freemarker.runtime:60 - Error executing FreeMarker template
      freemarker.core.NonBooleanException: For "#if" condition: Expected a boolean, but this has evaluated to an extended_hash+string (org.apache.struts2.dispatcher.Parameter$Empty wrapped into f.e.b.StringModel):
      ==> parameters.compressed?default(true) [in template "template/jquery/head.ftl" at line 44, column 6]

      ----
      FTL stack trace ("~" means nesting-related):
      - Failed at: #if parameters.compressed?default(true) [in template "template/jquery/head.ftl" at line 44, column 1]
      ---- 

      The file "template/jquery/head.ftl" is from struts2-jquery-plugin (version 4.0.3).

       

      The stack trace contains this:

      [WARNING] /home.action
      javax.servlet.ServletException: javax.servlet.ServletException: java.lang.RuntimeException: org.apache.jasper.JasperException: java.lang.IllegalStateException: Exception occurred when flushing data

       

      Version 2.5.26 of struts-core is working fine. I bisected the git history and found that the problem first appears with commit a65b8d5d5.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              SebastianHenz Sebastian Henz DT
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: