I’m working on a Struts application that uses the Struts Bootstrap plugin. I upgraded it to Struts V6 by installing theses libs:
commons-fileupload-1.4.jar commons-lang3-3.10.jar freemarker-2.3.31.jar log4j-api-2.17.2.jar ognl-3.3.2.jar struts2-core-6.0.0.jar commons-text-1.8.jar log4j-1.2-api-2.17.0.jar log4j-core-2.17.0.jar struts2-bootstrap-plugin-4.0.1.jar The application now serves static content with no problem, but whenever a form that uses bootstrap is accessed, this error message results: [ERROR] 2022-06-23 16:52:19 [https-jsse-nio-8443-exec-70] runtime - Error executing FreeMarker template freemarker.core._MiscTemplateException: Template inclusion failed (for parameter value "/template/~~~bootstrap/controlheader-core.ftl"): Syntax error in template "template/~~~bootstrap/controlheader-core.ftl" in line 51, column 44: Using ?html (legacy escaping) is not allowed when auto-escaping is on with a markup output format (HTML), to avoid double-escaping mistakes. (Stack trace follows below). Here’s the source code for a test page that I put up to demonstrate the problem: <%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp" %> <%@page import="org.personalitypad.utility.Config" %> <%@page import="org.personalitypad.utility.JspLogger" %> <%@page import="org.apache.log4j.Logger" %> <%@taglib prefix="s" uri="/struts-tags" %> <%@taglib prefix="sj" uri="/struts-jquery-tags" %> <%@taglib prefix="sb" uri="/struts-bootstrap-tags" %> <!-- jsp:include page="../include/check_login.jsp"/ --> <!-- jsp:include page="../include/check_project_admin.jsp"/ --> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Personality Pad | Test</title> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <jsp:include page="../include/analytics.html"/> <!-- Struts2 includes --> <s:head /> <sj:head /> <sb:head includeScripts="true" /> <link rel="stylesheet" href="css/2col.css" /> </head> <body> <div id="container"> <jsp:include page="../include/header.html"/> <jsp:include page="../include/sidebar.jsp"/> <div id="content"> <s:actionerror theme="bootstrap"/> <s:actionmessage theme="bootstrap"/> <h1>Test</h1> <s:form action="Test" theme="bootstrap" cssClass="form-vertical"> <s:textfield label="Email Address" name="userId" size="50" maxlength="50" tooltip="Enter the email address with which you registered." /> <s:password label="Password" name="password" /> <s:submit value="Sign In" class="btn btn-outline-primary"/> </s:form> </div> <jsp:include page="../include/footer.html"/> </div> </body> </html> I would appreciate any suggestions for how to fix this. Thanks, Ralph Grove FTL stack trace ("~" means nesting-related): - Failed at: #include "/${parameters.templateDir}/... [in template "template/~~~bootstrap/controlheader.ftl" at line 21, column 1] - Reached through: #include "/${parameters.templateDir}/... [in template "template/bootstrap/text.ftl" at line 21, column 1] ---- at freemarker.core.Include.accept(Include.java:164) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.visit(Environment.java:347) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.visit(Environment.java:353) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.include(Environment.java:2955) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Include.accept(Include.java:171) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.visit(Environment.java:347) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.visit(Environment.java:353) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.process(Environment.java:326) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.template.Template.process(Template.java:383) ~[freemarker-2.3.31.jar:2.3.31] at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:154) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:588) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.components.UIBean.end(UIBean.java:547) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:40) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.jsp.WEB_002dINF.jsp.test_jsp._jspx_meth_s_005ftextfield_005f0(test_jsp.java:452) ~[?:?] at org.apache.jsp.WEB_002dINF.jsp.test_jsp._jspx_meth_s_005fform_005f0(test_jsp.java:397) ~[?:?] at org.apache.jsp.WEB_002dINF.jsp.test_jsp._jspService(test_jsp.java:224) ~[?:?] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71) ~[jasper.jar:9.0.43] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:4.0.FR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:467) ~[jasper.jar:9.0.43] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:378) ~[jasper.jar:9.0.43] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:326) ~[jasper.jar:9.0.43] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.43] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.43] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) ~[catalina.jar:9.0.43] at org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:169) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:206) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:363) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:280) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:179) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.FetchMetadataInterceptor.intercept(FetchMetadataInterceptor.java:76) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.CoopInterceptor.intercept(CoopInterceptor.java:57) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.CoepInterceptor.intercept(CoepInterceptor.java:56) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:143) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:146) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:146) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:202) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:67) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:133) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:89) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:242) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:101) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:142) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:161) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:175) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.csp.CspInterceptor.intercept(CspInterceptor.java:44) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:140) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:209) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:229) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:196) ~[struts2-core-6.0.0.jar:6.0.0] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:637) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:140) ~[struts2-core-6.0.0.jar:6.0.0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.43] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.43] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[catalina.jar:9.0.43] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[catalina.jar:9.0.43] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:667) ~[catalina.jar:9.0.43] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[catalina.jar:9.0.43] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[catalina.jar:9.0.43] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) ~[catalina.jar:9.0.43] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[catalina.jar:9.0.43] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) ~[catalina.jar:9.0.43] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) ~[tomcat-coyote.jar:9.0.43] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-coyote.jar:9.0.43] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887) ~[tomcat-coyote.jar:9.0.43] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684) ~[tomcat-coyote.jar:9.0.43] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:9.0.43] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:9.0.43] at java.lang.Thread.run(Thread.java:835) ~[?:?] Caused by: freemarker.core.ParseException: Syntax error in template "template/~~~bootstrap/controlheader-core.ftl" in line 51, column 44: 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) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.PrimaryExpression(FMParser.java:595) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.UnaryExpression(FMParser.java:707) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:822) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.AdditiveExpression(FMParser.java:774) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.RangeExpression(FMParser.java:950) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.RelationalExpression(FMParser.java:902) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.EqualityExpression(FMParser.java:865) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.AndExpression(FMParser.java:1017) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.OrExpression(FMParser.java:1039) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.Expression(FMParser.java:552) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.StringOutput(FMParser.java:1674) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.MixedContentElements(FMParser.java:3968) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.UnifiedMacroTransform(FMParser.java:3009) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:3664) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.MixedContentElements(FMParser.java:4019) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.FMParser.Root(FMParser.java:4665) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.template.Template.<init>(Template.java:252) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:548) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.cache.TemplateCache.getTemplateInternal(TemplateCache.java:439) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:292) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.template.Configuration.getTemplate(Configuration.java:2836) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Environment.getTemplateForInclusion(Environment.java:2913) ~[freemarker-2.3.31.jar:2.3.31] at freemarker.core.Include.accept(Include.java:162) ~[freemarker-2.3.31.jar:2.3.31] ... 110 more --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org