>source

요청 된 개체를 HTML로 표시하고 싶은데 오류가 발생하는데 내 오류의 원인이 무엇인지 모르겠습니다. Google이 도와 줄 수 없었고 지금 물어 보려고합니다. 나는 그것을 주석 처리하고 오류가 여전히 발생하기 때문에 오류가 내 테이블에서 비롯된 것이라고 생각하지 않습니다. 유효한 값으로 유효한 JSON을 다시 가져 오기 때문에 오류는 "http : // localhost : 8081/simulation"에서도 발생하지 않습니다. 도움을 주셔서 감사합니다 :).

내 코드는 다음과 같습니다.

ApiController.java :

package de.WI18C.Gruppe5.API.controller;
import de.WI18C.Gruppe5.API.model.Unternehmen;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
@Controller
public class APIContoller {
@RequestMapping(value = "/unternehmen", method = RequestMethod.GET)
public String viewUnternehmen(Model model) {
    RestTemplate restTemplate = new RestTemplate();
    Unternehmen unternehmen = restTemplate.getForObject("http://localhost:8081/simulation", Unternehmen.class);
    model.addAttribute("unternehmen", unternehmen);
    return "unternehmen";
   }
}

unternehmen.html :

<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" lang="de">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <title>Unternehmen</title>
</head>
<body>
<div class="col-12 align-content-center">
    <div class="row">
        <div class="col-8 mx-auto">
            <table class="table">
                <thead>
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">Attribut</th>
                    <th scope="col">Wert</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <th scope="row">1</th>
                    <td>Name</td>
                    <td th:text="${unternehmen.getName()}"></td>
                </tr>
                <tr>
                    <th scope="row">2</th>
                    <td>Bestand</td>
                    <td th:text="${unternehmen.getBestand()}"></td>
                </tr>
                <tr>
                    <th scope="row">3</th>
                    <td>Bedarf</td>
                    <td th:text="${unternehmen.getBedarf()}"></td>
                </tr>
                <tr>
                    <th scope="row">4</th>
                    <td>Verkaufspreis</td>
                    <td th:text="${unternehmen.getVerkaufspreis()}"></td>
                </tr>
                <tr>
                    <th scope="row">5</th>
                    <td>Gewinn</td>
                    <td th:text="${unternehmen.getGewinn()}"></td>
                </tr>
                <tr>
                    <th scope="row">6</th>
                    <td>Bestand - Rad</td>
                    <td th:text="${unternehmen.getBestand_rad()}"></td>
                </tr>
                <tr>
                    <th scope="row">7</th>
                    <td>Bestand - Rahmen</td>
                    <td th:text="${unternehmen.getBestand_rahmen()}"></td>
                </tr>
                <tr>
                    <th scope="row">8</th>
                    <td>Bestand - Lenker</td>
                    <td th:text="${unternehmen.getBestand_lenker()}"></td>
                </tr>
                <tr>
                    <th scope="row">9</th>
                    <td>Bestand - Licht</td>
                    <td th:text="${unternehmen.getBestand_licht()}"></td>
                </tr>
                <tr>
                    <th scope="row">10</th>
                    <td>Bestand - Schaltung</td>
                    <td th:text="${unternehmen.getBestand_schaltung()}"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
        crossorigin="anonymous"></script>
</body>
</html>

"http : // localhost : 8080/unternehmen"을 호출하면 오류가 발생합니다 (포맷이 잘못되어 죄송합니다).

2020-12-16 15 : 07 : 55.635 오류 3696 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF] [http-nio-8080-exec-1] 예외 처리 템플릿 "unternehmen" : 템플릿 구문 분석 중 오류가 발생했습니다 (템플릿 : "클래스 경로 리소스 [templates/unternehmen.html]").

org.thymeleaf.exceptions.TemplateInputException : 템플릿 구문 분석 중 오류가 발생했습니다 (템플릿 : "클래스 경로 리소스 [templates/unternehmen.html]"). org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse (AbstractMarkupTemplateParser.java:241) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone (AbstractMarkupTemplateParser.java:100) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.TemplateManager.parseAndProcess (TemplateManager.java:649) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.TemplateEngine.process (TemplateEngine.java:1098) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.TemplateEngine.process (TemplateEngine.java:1072) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.spring5.view.ThymeleafView.renderFragment (ThymeleafView.java:362) ~ [thymeleaf-spring5-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.spring5.view.ThymeleafView.render (ThymeleafView.java:189) ~ [thymeleaf-spring5-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.springframework.web.servlet.DispatcherServlet.render (DispatcherServlet.java:1394) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.DispatcherServlet.processDispatchResult (DispatcherServlet.java:1139) ~ [spring-webmvc-5.3.1.jar : 5.3.1]org.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:1078) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:961) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:1006) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:898) ~ [spring-webmvc-5.3.1.jar : 5.3.1] javax.servlet.http.HttpServlet.service (HttpServlet.java:626) ~ [tomcat-embed-core-9.0.39.jar : 4.0.FR] org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:883) ~ [spring-webmvc-5.3.1.jar : 5.3.1] javax.servlet.http.HttpServlet.service (HttpServlet.java:733) ~ [tomcat-embed-core-9.0.39.jar : 4.0.FR] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:231) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서 org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:53) ~ [tomcat-embed-websocket-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.RequestContextFilter.doFilterInternal (RequestContextFilter.java:100) ~ [spring-web-5.3.1.jar : 5.3.1] org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.FormContentFilter.doFilterInternal (FormContentFilter.java:93) ~ [spring-web-5.3.1.jar : 5.3.1] org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (CharacterEncodingFilter.java:201) ~ [spring-web-5.3.1.jar : 5.3.1] org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:202) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:97) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:542) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:143) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:92) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:78) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:343) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.coyote.http11.Http11Processor.service (Http11Processor.java:374) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서 org.apache.coyote.AbstractProcessorLight.process (AbstractProcessorLight.java:65) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.coyote.AbstractProtocol $ConnectionHandler.process (AbstractProtocol.java:868) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.util.net.NioEndpoint $SocketProcessor.doRun (NioEndpoint.java:1590) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.util.net.SocketProcessorBase.run (SocketProcessorBase.java:49) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1130) ~ [na : na]에서 java.base/java.util.concurrent.ThreadPoolExecutor $Worker.run (ThreadPoolExecutor.java:630) ~ [na : na] org.apache.tomcat.util.threads.TaskThread $WrappingRunnable.run (TaskThread.java:61) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] java.base/java.lang.Thread.run (Thread.java:832) ~ [na : na]에서 원인 : org.attoparser.ParseException : 이름은 null이거나 비어있을 수 없습니다. org.attoparser.MarkupParser.parseDocument (MarkupParser.java:393) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupParser.parse (MarkupParser.java:257) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse (AbstractMarkupTemplateParser.java:230) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] ... 48 개의 공통 프레임 생략 원인 : java.lang.IllegalArgumentException : 이름은 null이거나 비어있을 수 없습니다. org.thymeleaf.engine.AttributeNames.forHTMLName (AttributeNames.java:478) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions $AttributeDefinitionRepository.storeAttribute (AttributeDefinitions.java:788) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE]에서 org.thymeleaf.engine.AttributeDefinitions $AttributeDefinitionRepository.getAttribute (AttributeDefinitions.java:677) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions.forHTMLName (AttributeDefinitions.java:405) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions.forName (AttributeDefinitions.java:336) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleAttribute (TemplateHandlerAdapterMarkupHandler.java:492) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler $InlineMarkupAdapterPreProcessorHandler.handleAttribute (InlinedOutputExpressionMarkupHandler.java:360) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleAttribute (OutputExpressionInlinePreProcessorHandler.java:260) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE]org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleAttribute (InlinedOutputExpressionMarkupHandler.java:205) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.attoparser.HtmlElement.handleAttribute (HtmlElement.java:250) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.HtmlMarkupHandler.handleAttribute (HtmlMarkupHandler.java:529) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupEventProcessorHandler.handleAttribute (MarkupEventProcessorHandler.java:593) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.ParsingAttributeSequenceUtil.parseAttributeSequence (ParsingAttributeSequenceUtil.java:220) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.ParsingElementMarkupUtil.parseOpenElement (ParsingElementMarkupUtil.java:153) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupParser.parseBuffer (MarkupParser.java:710) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupParser.parseDocument (MarkupParser.java:301) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] ... 50 개의 공통 프레임 생략

2020-12-16 15 : 07 : 55.638 오류 3696 --- [nio-8080-exec-1] oaccC [. [. [/]. [dispatcherServlet] : Servlet.service () for servlet [dispatcherServlet] in context with 경로 []에서 예외가 발생했습니다. [요청 처리에 실패했습니다. 중첩 된 예외는 org.thymeleaf.exceptions.TemplateInputException : 템플릿 구문 분석 중에 오류가 발생했습니다 (템플릿 : "클래스 경로 리소스 [templates/unternehmen.html]")] 근본 원인

java.lang.IllegalArgumentException : 이름은 null이거나 비어있을 수 없습니다. org.thymeleaf.engine.AttributeNames.forHTMLName (AttributeNames.java:478) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions $AttributeDefinitionRepository.storeAttribute (AttributeDefinitions.java:788) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE]에서 org.thymeleaf.engine.AttributeDefinitions $AttributeDefinitionRepository.getAttribute (AttributeDefinitions.java:677) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions.forHTMLName (AttributeDefinitions.java:405) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.AttributeDefinitions.forName (AttributeDefinitions.java:336) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleAttribute (TemplateHandlerAdapterMarkupHandler.java:492) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler $InlineMarkupAdapterPreProcessorHandler.handleAttribute (InlinedOutputExpressionMarkupHandler.java:360) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleAttribute (OutputExpressionInlinePreProcessorHandler.java:260) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleAttribute (InlinedOutputExpressionMarkupHandler.java:205) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.attoparser.HtmlElement.handleAttribute (HtmlElement.java:250) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.HtmlMarkupHandler.handleAttribute (HtmlMarkupHandler.java:529) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupEventProcessorHandler.handleAttribute (MarkupEventProcessorHandler.java:593) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.ParsingAttributeSequenceUtil.parseAttributeSequence (ParsingAttributeSequenceUtil.java:220) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.ParsingElementMarkupUtil.parseOpenElement (ParsingElementMarkupUtil.java:153) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupParser.parseBuffer (MarkupParser.java:710) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.attoparser.MarkupParser.parseDocument (MarkupParser.java:301) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE]org.attoparser.MarkupParser.parse (MarkupParser.java:257) ~ [attoparser-2.0.5.RELEASE.jar : 2.0.5.RELEASE] org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse (AbstractMarkupTemplateParser.java:230) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone (AbstractMarkupTemplateParser.java:100) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.engine.TemplateManager.parseAndProcess (TemplateManager.java:649) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.TemplateEngine.process (TemplateEngine.java:1098) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.TemplateEngine.process (TemplateEngine.java:1072) ~ [thymeleaf-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.spring5.view.ThymeleafView.renderFragment (ThymeleafView.java:362) ~ [thymeleaf-spring5-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.thymeleaf.spring5.view.ThymeleafView.render (ThymeleafView.java:189) ~ [thymeleaf-spring5-3.0.11.RELEASE.jar : 3.0.11.RELEASE] org.springframework.web.servlet.DispatcherServlet.render (DispatcherServlet.java:1394) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.DispatcherServlet.processDispatchResult (DispatcherServlet.java:1139) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:1078) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:961) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:1006) ~ [spring-webmvc-5.3.1.jar : 5.3.1] org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:898) ~ [spring-webmvc-5.3.1.jar : 5.3.1] javax.servlet.http.HttpServlet.service (HttpServlet.java:626) ~ [tomcat-embed-core-9.0.39.jar : 4.0.FR] org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:883) ~ [spring-webmvc-5.3.1.jar : 5.3.1] javax.servlet.http.HttpServlet.service (HttpServlet.java:733) ~ [tomcat-embed-core-9.0.39.jar : 4.0.FR] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:231) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서 org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:53) ~ [tomcat-embed-websocket-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.RequestContextFilter.doFilterInternal (RequestContextFilter.java:100) ~ [spring-web-5.3.1.jar : 5.3.1] org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.FormContentFilter.doFilterInternal (FormContentFilter.java:93) ~ [spring-web-5.3.1.jar : 5.3.1]org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (CharacterEncodingFilter.java:201) ~ [spring-web-5.3.1.jar : 5.3.1] org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:119) ~ [spring-web-5.3.1.jar : 5.3.1] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:202) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:97) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:542) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서 org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:143) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:92) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:78) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:343) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.coyote.http11.Http11Processor.service (Http11Processor.java:374) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39]에서 org.apache.coyote.AbstractProcessorLight.process (AbstractProcessorLight.java:65) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.coyote.AbstractProtocol $ConnectionHandler.process (AbstractProtocol.java:868) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.util.net.NioEndpoint $SocketProcessor.doRun (NioEndpoint.java:1590) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] org.apache.tomcat.util.net.SocketProcessorBase.run (SocketProcessorBase.java:49) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1130) ~ [na : na]에서 java.base/java.util.concurrent.ThreadPoolExecutor $Worker.run (ThreadPoolExecutor.java:630) ~ [na : na] org.apache.tomcat.util.threads.TaskThread $WrappingRunnable.run (TaskThread.java:61) ~ [tomcat-embed-core-9.0.39.jar : 9.0.39] java.base/java.lang.Thread.run (Thread.java:832) ~ [na : na]에서


  • 답변 # 1

    템플릿에 문제가 있습니다. 로컬로 복제 할 수 없었지만 그 오류는 파싱 할 때 일부 템플릿 태그가 올바르지 않음을 의미합니다. 슬프게도 Thymeleaf 오류는 잘 전달되지 않습니다.

    다음 두 가지를 시도 할 수 있습니다.

    A) 디버깅

    org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler : 492에 중단 점을 넣습니다.

    보기를 실행하고 애플리케이션이 492 행에서 중지되는지 확인하십시오.

    변수가 될 때까지 반복해야합니다. attributeName (490 행에서) null 값이 있습니다 (내가 이해하는 것은 귀하의 문제입니다)

    이 시점에서 nameLine 및 nameCol 매개 변수를 검사 할 수 있으며 문제가있는 줄과 문자를 알 수 있어야합니다.

    B) 디버깅이 너무 많으면 새 템플릿을 처음부터 다시 빌드하여 단계별로 테스트 할 수 있습니다 (템플릿 파일을 변경할 때마다 애플리케이션을 다시 시작해야한다고 생각합니다).

    행운을 빕니다!

  • 답변 # 2

    내부 게터 사용 제거 thymeleaf 다음과 같이 사용하십시오.

    <td th:text="${unternehmen.name}"></td>
    <td th:text="${unternehmen.bestand}"></td>
    
    

    모든 속성에 대해 수행하면 작동합니다.

  • 답변 # 3

    이제 완전히 새로운 HTML을 작성하고 작동합니다. 실제로 동일한 문서이지만 새 문서에서 "meta"태그를 다르게 사용합니다.

    낡은:

    <!doctype html>
    <html xmlns:th="http://www.thymeleaf.org">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
              integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
        <title>Unternehmen</title>
    </head>
    <body>
    <!-- My Table -->
    </body>
    </html>
    
    

    새로운:

    <!doctype html>
    <html xmlns:th="http://www.thymeleaf.org">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- Bootstrap CSS -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
              integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
        <title>Unternehmen</title>
    </head>
    <body>
    <!-- My Table -->
    </body>
    </html>
    
    

    .... 그게 다야. 나는 동일한 Java 컨트롤러와 다른 모든 것을 가지고 있습니다. 시간과 조언을 위해 want2learn과 LucasJC에게 감사드립니다.

  • 이전 sql - 여러 행의 합계/또는 중첩 합계로 MySQL 순서?
  • 다음 c - openssl 라이브러리를 사용하여 수동으로 암호화 키 찾기