有错误信息:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
错误原因:在Intellij中application.properties中定义了spring.velocity.toolbox-config-location=toolbox.xml,但是我本身并没有引入toolbox.xml这个文件,导致访问时缺乏toolbox中的相关工具,而我插入了一个关于日期的toolbox应用:
<toolbox>
<tool>
<key>date</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.DateTool</class>
</tool>
</toolbox>
则会出现警告,但是运行没问题,可以访问该前端页面: