org.apache.jasper.JasperException:更新到 struts 6.3.0.2 时处理 [/jsp/include/actionError.jsp] 时发生异常

问题描述 投票:0回答:1

org.apache.jasper.JasperException:在第 [61] 行处理 [/jsp/include/actionError.jsp] 时发生异常

58: 59: 60: 61: 62:

我正在尝试从 2.5.33 升级到 struts 6.3.0.2,当我尝试运行我的应用程序时,会发生此错误。您能否告诉我第 61 行错误的原因是什么?

第 61 行可以进行哪些更改?

附加信息:

原因:模板“strutsTemplates/actionmessage.ftl”第3行第46列语法错误: 当使用标记输出格式 (HTML) 启用自动转义时,不允许使用 ?html(传统转义),以避免双重转义错误。 文件:FMParser.java

class="${parameters.cssClass?html}"<#rt/>

struts2 struts2-jquery struts2-interceptors struts2-json-plugin struts2-jquery-plugin
1个回答
0
投票

升级到 Struts 6.x 后,Freemarker 也会升级。新的 Freemarker 版本默认使用 auto-escape。但您的旧模板仍然使用

?html
来显示输出。

迁移指南建议您停止使用

?html

迁移到最新的 Freemarker(默认情况下启用自动转义)后,您应该停止在自定义标签和基于 freemarker 的页面中使用

?html

© www.soinside.com 2019 - 2024. All rights reserved.