当前位置:网站首页>98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request
98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request
2022-04-23 12:40:00 【Thomas kutao】
Error message
2022-04-22 12:59:38.904 ERROR 16164 --- [nio-8888-exec-1] freemarker.runtime : Error executing FreeMarker template
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> pageContext [in template "courseAdd.html" at line 84, column 29]----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like 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 parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
--------
FTL stack trace ("~" means nesting-related):
- Failed at: ${pageContext.request.contextPath} [in template "courseAdd.html" at line 84, column 27]
----
Back end code
The front-end code
Its function is to realize the drop-down box , Added option But it doesn't show ( Here's the picture ), And the back-end data has been obtained ( It's printed on the console ), I thought I couldn't get data from the front-end .
Look back and report the wrong information , Find out
o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
The general meaning is :Servlet Request processing failed , May be null or missing
Problem analysis
That should be the problem of null value , As a result, the drop-down box cannot be displayed normally ,teacherNames There is a null value in
Log The treatment method is given, that is ( Red and bold tips above ) add to
<div class="layui-input-block">
<!-- <#if myOptionalVar??>when-present<#else>when-missing</#if>-->
<select id="baseCourseSelect" lay-search>
<option>-- Please select ——</option>
<#list teacherNames as tname>
<option value="${tname}">${tname}</option>
</#list>
</select>
</div>
Later, the final solution was found by searching :
Problem solving
In the configuration item (application.yml) Add the setting of global de null value in :
spring.freemarker.settings.classic_compatible= true
Be careful true There is a space in front , Otherwise it won't work .
Final effect
版权声明
本文为[Thomas kutao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231153217480.html
边栏推荐
- 云原生KubeSphere部署Mysql
- Realize several "Postures" in which a box is horizontally and vertically centered in the parent box
- C, calculation code of parameter points of two-dimensional Bezier curve
- bert-base-chinese下载(智取)
- mysql中 innoDB执行过程分析
- PHP generates JSON to process Chinese
- [csnote] ER diagram
- 风尚云网学习-h5的input:type属性的image属性
- 没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版
- How to solve the computer system card?
猜你喜欢
Plato Farm-以柏拉图为目标的农场元宇宙游戏
Worder font page font comparison table
Fashion cloud learning - input attribute summary
A graphic designer's fantasy world | ones characters
Pagoda panel command line help tutorial (including resetting password)
One way ANOVA of SPSS
leetcode:437. Path sum III [DFS selected or not selected?]
The maximum number of remote desktop servers has been exceeded
Try the server for one month for free, and attach the tutorial
box-sizing
随机推荐
A graphic designer's fantasy world | ones characters
On using go language to create websocket service
How do traditional enterprises cope with digital transformation? These books give you the answer
[vulnhub range] - DC2
【微信小程序】z-index失效
Resolve disagrees about version of symbol device_ create
栈和队列a
Markdown语法学习
梳理网络IP代理的几大用途
解锁OpenHarmony技术日!年度盛会,即将揭幕!
Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
Uni app native app local packaging integrated Aurora push (jg-jpush) detailed tutorial
Baserecyclerviewadapterhelper realizes pull-down refresh and pull-up loading
Pagoda panel command line help tutorial (including resetting password)
风尚云网学习-input属性总结
洛谷P5540 [BalkanOI2011] timeismoney | 最小乘积生成树 题解
[daily question] chessboard question
What are the forms of attack and tampering on the home page of the website
php生成json处理中文
BUUCTF WEB [BJDCTF2020]The mystery of ip