简体   繁体   English

Spring Boot Thymeleaf 服务器错误,状态=500

[英]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.

相关问题 Spring Boot-发生意外错误(类型=内部服务器错误,状态= 500) - Spring Boot - There was an unexpected error (type=Internal Server Error, status=500) Spring-boot 出现“出现意外错误(类型=内部服务器错误,状态=500)”的问题。 - Spring-boot issue with “There was an unexpected error (type=Internal Server Error, status=500).” Spring 引导白标签错误页面(类型=内部服务器错误,状态=500) - Spring Boot Whitelabel Error page (type=Internal Server Error, status=500) Spring 引导战争文件 Tomcat 9 部署帮助状态 500 错误 - Spring Boot War File Tomcat 9 Deployment Help Status 500 Error Websockets返回状态500错误的Java Spring Boot项目 - Java Spring Boot project with Websockets returning status 500 error Thymeleaf错误Spring Boot JPA - Thymeleaf error spring boot jpa Thymeleaf + Spring Boot:错误页面 - Thymeleaf + Spring Boot: Error Page Spring Boot 使用 Post 方法获取 500 内部服务器错误 - Spring Boot Get a 500 Internal Server Error with Post method Spring Boot Post API 中的 500 内部服务器错误 - 500 Internal Server Error in spring boot post API Spring Boot中出现500 Internal Server Error(而不是404) - 500 Internal Server Error instead of 404 in Spring Boot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM