[英]Spring Boot Thymeleaf Server Error, status=500
I've got Spring Boot app, which works on localhost.我有 Spring Boot 应用程序,它可以在本地主机上运行。 But after deploy .war file on my server on some pages i recieve:
但是在我收到的某些页面上在我的服务器上部署 .war 文件后:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sun Jan 26 15:49:46 CET 2020
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template [/user/instruction/disable-script], template might not exist or might not be accessible by any of the configured Template Resolvers
On localhost this page is working.在本地主机上,此页面正在运行。 Problem is only on server.
问题仅在服务器上。
disable-script.html:禁用脚本.html:
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org"
layout:decorate="~{fragments/user/layout}">
<head>
<title>...</title>
</head>
<body>
<div layout:fragment="content" th:remove="tag">
.....
</div>
</body>
</html>
Controller fragment:控制器片段:
@RequestMapping(value = "/user/instruction/disable-script", method = RequestMethod.GET)
public String instructionDisableScript(WebRequest request, Model model) {
return "/user/instruction/disable-script";
}
Some pages on server are working.服务器上的某些页面正在运行。 I don't have any idea why some of them are throwing this error 500...
我不知道为什么他们中的一些人会抛出这个错误 500 ...
这可能是因为在部署后,模板的查找发生了变化,请尝试使用以下配置运行您的服务器: spring.thymeleaf.prefix=classpath:/templates/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.