获取速度错误 "unable to find resource 'error.vm' in any resource loader."

Getting velocity error "unable to find resource 'error.vm' in any resource loader."

我有一个基于 Spring boot 1.3.3 的 REST API。我仅将 Velocity 用于电子邮件模板。

没有 JSP/HTML 视图。我只使用 Spring.

的 RestController

有时,我会收到此错误:"ResourceManager : unable to find resource 'error.vm' in any resource loader." 仅请求此 vm 文件。

我是否应该禁用我的 Spring 引导应用程序的某些内容以禁用此错误?

我相信 Velocity 正在寻找这个模板,如果它有错误,所以你可能有一个模板问题,它试图获取错误内容但不能。每 http://s2velocity.sandbox.seasar.org/en/error_template.html "when an error caught in a view template and rendering is forwarded to error.vm."

您可以根据文档在 属性 文件中更改此名称。

我认为您不想隐藏这些消息,因此您应该尝试捕获错误并查看问题所在。