JFinal在数据库中读取数据查不到该列的问题

发布于 2021-11-30 19:05:46 字数 5738 浏览 702 评论 4

在读取一个数据表中的全部数据的时候,有一列数据总是无法显示,但是这列数据真实存在并且值不为NULL,请各位大神帮忙解答一些是什么原因

[ERROR]-[Thread: qtp1889735576-18]-[freemarker.log._Log4JLoggerFactory$Log4JLogger.error()]: Error executing FreeMarker template

FreeMarker template error:
The following has evaluated to null or missing:
==> i.crop_name  [in template "template/brand/detail.html" at line 64, column 50]


Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??


The failing instruction (FTL stack trace):
----------
==> ${i.crop_name}  [in template "template/brand/detail.html" at line 64, column 48]
    #list applyId as i  [in template "template/brand/detail.html" at line 59, column 17]
    #nested  [in template "template/common/_mainlayout.html" in macro "mainlayout" at line 44, column 33]
    @mainlayout pageCSS=pageCSS pageJavas...  [in template "template/brand/detail.html" at line 46, column 1]
----------


Java stack trace (for programmers):
----------
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98)
at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:181)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:509)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:103)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:86)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.visit(Environment.java:487)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Macro$Context.runMacro(Macro.java:209)
at freemarker.core.Environment.visit(Environment.java:694)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.process(Environment.java:243)
at freemarker.template.Template.process(Template.java:277)
at com.jfinal.render.FreeMarkerRender.render(FreeMarkerRender.java:145)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:97)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

伪装你 2021-12-03 16:41:48

|你这样可能是因为表名和字段名重了?我是因为字段名写错了= =字母太顺手一直没看出来

倾城泪 2021-12-03 14:59:11

回复
@lyra_vv587 : 我用的是postgresql , 我把sql语句执行了一下发现了奇怪的事情,user是系统的表,select * from user 结果: |current_user| |--------------| |postgres

混吃等死 2021-12-03 14:31:40

回复
@赵明威 : 这个我没有用过= =用jfinal里面做查询的时候这种的时候我都是select 表名.*的,然后不加表名会出点问题。我也是一知半解你参考一下看看好了= =

德意的啸 2021-12-03 12:47:45

怎么解决的呢,我的是因为我的表名使用了user , 才导致找不到字段,后来我把表名改成了 admin_user,才好了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文