当前位置:网站首页>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
边栏推荐
猜你喜欢

Sort out several uses of network IP agent

ZigBee CC2530 minimum system and register configuration (1)

【csnote】ER图

Introduction to kubernetes

C set Logo Icon and shortcut icon

【unity笔记】L4Unity中的基础光照

Pagoda panel command line help tutorial (including resetting password)

Worder font page font comparison table

使用Source Insight查看编辑源代码

XinChaCha Trust SSL Organization Validated
随机推荐
How to switch PHP version in Windows 2008 system
On using go language to create websocket service
How do programmers finalize nucleic acid statistics with 130 lines of code
Can I take the CPDA data analyst certificate for 0 foundation
Qt重绘事件与剪切
STM32 control stepper motor (ULN2003 + 28byj)
Qt一个进程运行另一个进程
Kubernetes 入门教程
Qt双缓冲绘图
云原生KubeSphere部署Redis
万事有你 未来可期 | ONES 2022校园招聘正式开启
Qt进程间通信
mysql中 innoDB执行过程分析
力扣刷题之完全二叉树的节点个数
How to prevent the website from being hacked and tampered with
Lesson 25 static member variables of classes
Fashion cloud learning - input attribute summary
0基础可以考CPDA数据分析师证书吗
A graphic designer's fantasy world | ones characters
Idea setting copyright information