스프링부트 3-09 글쓴이 표시 질문드립니다.

해당 소스코드를 따라하고 질문을 등록하면

<html layout:decorate="~{layout}" xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml">
<div layout:fragment="content" class="container my-3">
    <table class="table">
        <thead class="table-dark">
        <tr class="text-center">
            <th>번호</th>
            <th style="width:50%">제목</th>
            <th>글쓴이</th>
            <th>작성일시</th>
        </tr>
        </thead>
        <tbody>
        <tr class="text-center" th:each="question, loop : ${paging}">
            <td th:text="${paging.getTotalElements - (paging.number * paging.size) - loop.index}"></td>
            <td class="text-start">
                <a th:href="@{|/question/detail/${question.id}|}" th:text="${question.subject}"></a>
                <span class="text-danger small ms-2" th:if="${#lists.size(question.answerList) > 0}"
                      th:text="${#lists.size(question.answerList)}">
                    </span>
            </td>
            <td><span th:if="${question.author != null}" th:text="${question.author.username}"></span></td>
            <td th:text="${#temporals.format(question.createDate, 'yyyy-MM-dd HH:mm')}"></td>
        </tr>
        </tbody>
    </table>
    <!-- 페이징처리 시작 -->
    <div th:if="${!paging.isEmpty()}">
        <ul class="pagination justify-content-center">
            <li class="page-item" th:classappend="${!paging.hasPrevious} ? 'disabled'">
                <a class="page-link"
                   th:href="@{|?page=${paging.number-1}|}">
                    <span>이전</span>
                </a>
            </li>
            <li th:each="page: ${#numbers.sequence(0, paging.totalPages-1)}"
                th:if="${page >= paging.number-5 and page <= paging.number+5}"
                th:classappend="${page == paging.number} ? 'active'"
                class="page-item">
                <a th:text="${page}" class="page-link" th:href="@{|?page=${page}|}"></a>
            </li>
            <li class="page-item" th:classappend="${!paging.hasNext} ? 'disabled'">
                <a class="page-link" th:href="@{|?page=${paging.number+1}|}">
                    <span>다음</span>
                </a>
            </li>
        </ul>
    </div>
    <!-- 페이징처리 끝 -->
    <a th:href="@{/question/create}" class="btn btn-primary">질문 등록하기</a>
</div>
</html>

![Imgur]https://imgur.com/a/xkXFjje 이렇게 제목이 표시가 안됩니다.
무엇이 문제일까요......

rhqudrnr153 163

M 2023년 3월 19일 10:27 오후

데이터를 데이터베이스에 직접 조회하여 제목 데이터가 저장되었는지 확인해 보세요. 데이터가 없다면 데이터를 저장하는 코드에 문제가 있을것 같습니다. - 박응용님, 2023년 3월 19일 10:29 오후 추천 , 대댓글
@박응용님 h2데이터베이스 조회 결과 subject의 값이 null로 되어있습니다 - rhqudrnr153님, 2023년 3월 19일 11:09 오후 추천 , 대댓글
목록으로