FreeMarker template error!
部署项目后发现以下“FreeMarker template error!”的问题,google、baidu猛一顿搜索无果后开始认真分析异常信息。
Error on line 72, column 6 in template/ajax/head.ftl
Expecting a boolean (true/false) expression here
Expression parameters.debug?default(false) does not evaluate to true/false
it is an instance of freemarker.ext.beans.StringModel
The problematic instruction:
----------
==> if parameters.debug?default(false) [on line 72, column 1 in template/ajax/head.ftl]
---------- Java backtrace for programmers:
----------
freemarker.core.NonBooleanException: Error on line 72, column 6 in template/ajax/head.ftl
Expecting a boolean (true/false) expression here
Expression parameters.debug?default(false) does not evaluate to true/false
it is an instance of freemarker.ext.beans.StringModel
at freemarker.core.Expression.isTrue(Expression.java:150)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:168)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530)
at org.apache.struts2.components.UIBean.end(UIBean.java:484)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
at org.apache.jsp.WebUI.UserCenter.modifyUserInfo_jsp._jspx_meth_sd_005fhead_005f0(modifyUserInfo_jsp.java:389)
at org.apache.jsp.WebUI.UserCenter.modifyUserInfo_jsp._jspService(modifyUserInfo_jsp.java:99)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
一句异常都没有看懂,但是发现和项目有关的两条异常,如下:
at org.apache.jsp.WebUI.UserCenter.modifyUserInfo_jsp._jspx_meth_sd_005fhead_005f0(modifyUserInfo_jsp.java:389)
at org.apache.jsp.WebUI.UserCenter.modifyUserInfo_jsp._jspService(modifyUserInfo_jsp.java:99)
打开tomcat部署的modifyUserInfo_jsp.java文件,定位到99行。
96 out.write("<!DOCTYPE html >\n");
97 out.write("<html>\n");
98 out.write("<head>\n");
99 if (_jspx_meth_sd_005fhead_005f0(_jspx_page_context))
100 return;
101 out.write("\n");
102 out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
和源代码进行对比
13 <!DOCTYPE html >
14 <html>
15 <head>
16 <sd:head/>
17 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
询问相关开发人员后,发现源代码16行为多余代码,删除后异常消除,没有再深入研究389行代码。
总结:遇到不认识、没见过的异常信息,不用害怕,认真分析,或许就是一个简单的语法错误。
FreeMarker template error!的更多相关文章
- cosbench 异常 FreeMarker template error: The following has evaluated to null or missing
问题现象: 使用Cosbench 0.4.2.c4 版本测试Ceph RGW read test失败,遇到异常如下: FreeMarker template error: The following ...
- Spring mvc 中使用ftl引用共通文件出错 FreeMarker template error: Error reading included file "/WEB-INF/ftl/common/errormessage.ftl"
初次接触spring mvc,想做一个小的练习项目,结果在ftl文件中引用其它的共通ftl文件时出错.
- FreeMarker template error: The following has evaluated to null or missing: ==> blogger.md [in template "admin/about.ftl" at line 44, column 84]
FreeMarker template error:The following has evaluated to null or missing:==> blogger.md [in templ ...
- FreeMarker template error: The following has evaluated to null or missing
使用freemarker前端分页,报错: FreeMarker template error: The following has evaluated to null or missing 后端直接赋 ...
- 关于Struts2的客户端校验的FreeMarker template error!
把<s:form action="login" namespace="/" validate="true" >改为 <s: ...
- springboot FreeMarker template error
注释掉<#list>xxx</#list> 现在运行就不报错了
- freemarker.template.TemplateException:Error parsing including template
1.错误描述 freemarker.template.TemplateException:Error parsing including template ftl/main.ftl:on line 6 ...
- freemarker.template.TemplateException:Error executing macro:mainSelect
1.错误描述 freemarker.template.TemplateException:Error executing macro:mainSelect require parameter:id i ...
- 异常-----freemarker.template.TemplateException:Error executing macro:mainSelect
1.错误描述 freemarker.template.TemplateException:Error executing macro:mainSelect require parameter:id i ...
随机推荐
- [CareerCup] 8.5 Online Book Reader System 在线读书系统
8.5 Design the data structures for an online book reader system. 这道题OOB的题让我们设计一个在线读书系统,还是没有任何提示,所以发挥 ...
- poj1067-取石子游戏-wythoff博弈
打表找规律失败,搜了一下原来是wythoff博弈 /*------------------------------------------------------------------------- ...
- javascript基础(1)
1.前言 ECMAscript解释,用来解释JS代码 DOM 文档对象模型,浏览器在做显示时需要渲染DOM树 BOM 浏览器对象模型,可以控制浏览器的行为,代码的兼容性很差 2.基本类型 数字类型: ...
- FilenameFilter用法
使用FilenameFilter实现图片过滤,只要.gif,.jpg,.png文件. java 代码 public class ImageFilter implements FilenameFilte ...
- 360极速浏览器使用postman
Postman-REST-Client_v0.8.4.14.zip文件请加群下载:74085440 步骤如下: 1.将crx文件打包成zip文件 2.解压打包的zip文件,并将_metadata文件夹 ...
- Svn-在eclipse中安装svn插件
在eclipse中安装svn有两种方式 1:直接下载svn的插件包安装 使用的版本为1.8.x Links for 1.8.x Release: Eclipse update site URL: ht ...
- 【Gym 100971J】Robots at Warehouse
题意 链接给你一个n*m的地图,'#'代表墙,‘.’代表可走的,1代表1号机器人,2代表2号机器人,机器人可以上下左右移动到非墙的位置,但不能走到另一个机器人身上.问能否交换1和2的位置. 分析 如果 ...
- Yii2 实现修改密码功能
YII2对密码加密生成的结果是不同的,即用相同的初始密码在不同时间得到的加密结果不同,所以我们不能用常用的方法去验证密码是否正确(将密码加密后与数据库中的密码相比较).YII2有自己的加密以及密码验证 ...
- Mac OS X系统下编译运行C代码
1.使用编译器将源文件中的代码转换为二进制代码,这个过程叫做编译. 将终端的工作路径切换到源文件所在的路径. cc -c 源文件的名称.例如:cc -c main.c 如果没有意外的话,就会在当前工作 ...
- Teradata 语句简单优化
Teradata 基本查询语言和SQL server 是一致的.有很小的区别. 功能没有SQL 全面,界面没有SQL 好看~ 1. teradata 里面经常会报一种错误: no enough spo ...