p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px '.PingFang SC'; color: #454545}
span.s1 {font: 12.0px '.PingFang SC'}
span.s2 {font: 12.0px 'Helvetica Neue'}
span.s3 {text-decoration: underline}
span.Apple-tab-span {white-space:pre}

严重: Servlet.service() for servlet [SpringMVC] in context with path [/zhuozhouzyy] threw exception [Request processing failed; nested exception is freemarker.core.NonMethodException: For "...(...)" callee: Expected a method, but this has evaluated to a string (wrapper: f.t.SimpleScalar):

==> itm.creatTimeString?string  [in template "techedu/index.jsp" at line 46, column 46]

----

FTL stack trace ("~" means nesting-related):

- Failed at: ${itm.creatTimeString?string("yyyy-MM...  [in template "techedu/index.jsp" at line 46, column 44]

----] with root cause

FreeMarker template error:

For "...(...)" callee: Expected a method, but this has evaluated to a string (wrapper: f.t.SimpleScalar):

==> itm.creatTimeString?string  [in template "techedu/index.jsp" at line 46, column 46]

----

FTL stack trace ("~" means nesting-related):

- Failed at: ${itm.creatTimeString?string("yyyy-MM...  [in template "techedu/index.jsp" at line 46, column 44]

----

Java stack trace (for programmers):

----

freemarker.core.NonMethodException: [... Exception message was already printed; see it above ...]

at freemarker.core.MethodCall._eval(MethodCall.java:84)

at freemarker.core.Expression.eval(Expression.java:78)

at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)

at freemarker.core.DollarVariable.accept(DollarVariable.java:41)

at freemarker.core.Environment.visit(Environment.java:324)

at freemarker.core.MixedContent.accept(MixedContent.java:54)

at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)

at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(IteratorBlock.java:268)

at freemarker.core.IteratorBlock$IterationContext.executeNestedBlock(IteratorBlock.java:220)

at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:194)

at freemarker.core.Environment.visitIteratorBlock(Environment.java:572)

at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78)

at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64)

at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)

at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)

at freemarker.core.Environment.visit(Environment.java:324)

at freemarker.core.MixedContent.accept(MixedContent.java:54)

at freemarker.core.Environment.visit(Environment.java:324)

at freemarker.core.Environment.process(Environment.java:302)

at freemarker.template.Template.process(Template.java:325)

at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:366)

at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:283)

at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:233)

at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)

at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)

at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225)

at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

错误原因:

<p>${itm.creatTimeString?string('yyyy-MM-dd')}</p>

由于 itm.creatTimeString 本身就是一个字符串,所以没有办法进行日期格式化;

解决方法:

要使用日期格式化,就需要使用日期类型的字段。

Freemarker Failed at: ${itm.creatTimeString?string("yyyy-MM... [in template的更多相关文章

  1. Excel日期格式单元格写成yyyy.MM.dd格式将无法读取到DataTable

    最近在改公司的订单系统,遇到了一个奇怪的问题.C#程序需要从Excel文件中将数据全部读取到DataTable,其中Excel文件的第一列是日期格式yyyy/MM/dd,而这一列中大部分的单元格都是按 ...

  2. Oracle中把一个DateTime的字符串转化成date类型。to_date('2016/12/8 18:55:43','yyyy/MM/dd hh24:mi:ss'),

    Oracle中把一个DateTime或者该形态字符串转化成date类型. to_date('2016/12/8 18:55:43','yyyy/MM/dd hh24:mi:ss'), 或者: sele ...

  3. 让用户输入一个日期字符串,将其转换成日期格式, 格式是(yyyy/MM/dd,yyyyMMdd,yyyy-MM-dd)中的一种, 任何一种转换成功都可以; 如果所有的都无法转换,输出日期格式非法。

    第三种方法 while(true) {             Date d;        System.out.println("正在进行第一次匹配,请稍后~—~");     ...

  4. 从客户端(ASPxFormLayout1$txtRule="<YYYY><MM><DD><XXXX>")中检测到有潜在危险的 Request.Form 值

    在有文本框的值属于这种时<YYYY><MM><DD><XXXX>,会报这个错 在webconfig中加入 <httpRuntime request ...

  5. C# 时间格式 yyyy/mm/dd

    今天遇到个问题在C#中将日期格式设置为yyyy/MM/dd,我是这样写的: DateTime.Now.ToString("yyyy/MM/dd"); 可是获取到的日期还是显示yyy ...

  6. DateTime.Now.ToString("yyyy/MM/dd") 输出的结果是 2006-03-16(转)

    今天我在使用 DateTime.Now.ToString("yyyy/MM/dd") 输出的结果是 2006-03-16 而不是我想要的 2006/03/16,都快把我郁闷的不行了 ...

  7. JS 2019-12-03T15:53:23.000+08:00 转化为 YYYY MM DD

    js时间格式转化 2019-12-03T15:53:23.000+08:00 转化为 YYYY MM DD var dateee = new Date(createTime).toJSON();var ...

  8. freemarker中遍历list<map<String,String>>

    <#list var as map><tr> <#list map?keys as itemKey> //关键点    <#if itemKey=" ...

  9. DateTime.Now.ToString("yyyy/MM/dd") 时间格式化中的MM为什么是大写的?

    如果MM是小写,就表示时间里的分钟yyyy-MM-dd HH:mm:ss (年-月-日 时:分:秒) yyyy-MM-dd HH:mm:ss 年-月-日 时:分:秒大写是为了区分“月”与“分” 顺便说 ...

随机推荐

  1. c++ 库 boost安装

    http://blog.chinaunix.net/uid-12226757-id-3427282.html ubuntu apt-get install libboost-dev 全部: apt-g ...

  2. HandlerSocket ---MySQL与NoSQL ---SQL与NoSQL的融合(转)

    项目地址:https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL 写这一篇内容的原因是MySQL5.6.2突然推出了memcached的功能 ...

  3. linux java环境配置

    一.安装 创建安装目录,在/usr/java下建立安装路径,并将文件考到该路径下: # mkdir /usr/java 1.jdk-6u11-linux-i586.bin 这个是自解压的文件,在lin ...

  4. Oracle数据安全(三)权限管理

    一.权限概述 所谓权限就是执行特定类型SQL命令或访问其他模式对象的权利.用户在数据库中可以执行什么样的操作,以及可以对哪些对象进行操作,完全取决于该用户所拥有的权限. 在Oracle中将权限分为系统 ...

  5. SQL TOP分页法

    原理: PageSize, PageIndex: 升序   order  by  a asc a的 值 大于, 上一页数据 最大的  a值. 降序  order by  a desc a的 值 小于, ...

  6. Linux内核参数之rp_filter

    一.rp_filter参数介绍 rp_filter参数用于控制系统是否开启对数据包源地址的校验. 首先看一下Linux内核文档documentation/networking/ip-sysctl.tx ...

  7. Python3:Django根据models生成数据库表时报 __init__() missing 1 required positional argument: 'on_delete'

    Python3:Django根据models生成数据库表时报 __init__() missing 1 required positional argument: 'on_delete' 一.分析 在 ...

  8. 把Arch Linux安装到U盘上的具体教程

    Arch Linux简介 Arch Linux(或称Arch)是一种以轻量简洁为设计理念的Linux发行版.其开发团队秉承简洁.优雅.正确和代码最小化的设计宗旨.Arch Linux 项目受 CRUX ...

  9. jQuery对象和dom对象的转换

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. 线段树 - HDU1166 - 敌兵布阵

    2017-07-29 16:41:00 writer:pprp 线段树跟区间操作相关,想要在题目限定的时间内解决问题就需要用线段树这种数据结构来解决: 线段树是一种二叉平衡树 参考书目:张新华的< ...