[점프 투 스프링 부트] 답변 페이징은 나오지만, 정렬은 404오류 나옵니다 살려주세요 ㅠ

SBB 3-15 추가기능 정렬에서 (1) 답변 페이징 및 정렬 기능을 도전하고 있는데요,

그냥 페이징 처리는 아주 매끄럽게 잘되는데,
그놈의 정렬기능이 절대 안됩니다.

URL에 이렇게 요청이 되는것 까지는 나옵니다.)
(http://localhost:8080/question/detail?sort=createDate&page=0)

하지만 404오류로 페이지 뷰가 표시되질 않습니다.
문제의 소스코드를 보여드리겠습니다.

QuestionController.java 의 detail 메소드

    public String detail(
            Model model, 
            @PathVariable("id") Integer id, 
            AnswerForm answerForm,
            @RequestParam(required = false, value="page", defaultValue="0") int page,
            @RequestParam(required = false, value="sort", defaultValue="createDate") String sort
            //import com.mysite.sbb.answer.AnswerForm;
             //detail에서 answerForm도 같이 사용하니까 넣어줘야 오류안걸림
            ) {

        Question question = this.questionService.getQuestion(id);
        Page<Answer> paging = this.answerService.getAnswerList(id, page,sort);
        model.addAttribute("question", question);
        model.addAttribute("paging", paging);
        return "question_detail";
    }

@RequestParam String sort 매개변수는 폼에서 입력받아서 정렬기능을 구현할 계획이었습니다.

AnswerRepository

public interface AnswerRepository extends JpaRepository<Answer, Integer> {
    //memo: 리포지터리(Repository) 만드는 공식 : 
    //sampleRepository extends(부모상속) JpaRepository<엔티티명, PK타입>

    //질문별 답변리스트 페이징
    Page<Answer> findAllByQuestion(Question question,Pageable pageable);


}

AnswerService

    //답변리스트 페이징
    public Page<Answer> getAnswerList(Integer id,int page,String sort){
        Question question = this.questionService.getQuestion(id);
//      List<Sort.Order> sort1 = new ArrayList<>();//최신순
//      sort1.add(Sort.Order.desc("createDate")); 

        //@RequestParam sort로 읽어오면 적용
        Pageable pageable = PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, sort));
        return this.answerRepository.findAllByQuestion(question, pageable);
    }

AnswerService의 매개변수 sort는 Sort.Direction.DESC 뒤에 넣으면 필드명으로 조회된다고 구글링에서 봐가지고 활용해봤습니다.

question.detail (script)

const sort_search = document.getElementById("sort_search");
btn_search.addEventListener('click', function() {
    document.getElementById('sortForm').submit();

});

question.detail (html)

<!-- 답변 추천순,최신순 페이징정렬 -->
    <form th:action="@{/question/detail}" method="get" id="sortForm"><!-- 최신순 -->
        <input class="btn btn-outline-info" type="hidden" id="sort" name="sort" th:value="createDate">
        <input type="hidden" id="page" name="page" th:value="${paging.number}">
        <button class="btn btn-outline-secondary" type="submit" id="sort_search">최신순</button>
    </form>
    <form th:action="@{/question/detail}" method="get" id="sortForm"><!-- 추천순 -->
        <input class="btn btn-outline-info" type="hidden" id="sort" name="sort" th:value="voter">
        <input type="hidden" id="page" name="page" th:value="${paging.number}">
        <button class="btn btn-outline-secondary" type="submit" id="sort_search">추천순</button>
    </form>

질문별 답변리스트 페이징 처리는 구현이 되나, 정렬만 하면
의도대로 URL에는 http://localhost:8080/question/detail?sort=createDate&page=0 이렇게 표시 되지만,
404오류가 나옵니다

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Dec 21 10:30:38 KST 2022
There was an unexpected error (type=Not Found, status=404).
No message available

해당오류 적었습니다.

어떤게 문제일까요?? ㅠㅠ
진짜 10시간정도 고생하고있습니다

buzz781 571

2022년 12월 21일 10:43 오전

화면에 표시되는 오류말고 콘솔에 표시되는 오류를 보여주세요. - 박응용님, 2022년 12월 21일 10:56 오전 추천 , 대댓글
@박응용님 콘솔 오류 문장은 이거입니다 2022-12-22T00:52:30.603+09:00 ERROR 16964 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet]  : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/question_detail.html]")] with root cause - buzz781님, M 2022년 12월 22일 12:54 오전 추천 , 대댓글
@buzz781님 작성하신 템플릿에 오류가 있는것 같습니다. - 박응용님, 2022년 12월 22일 1:00 오전 추천 , 대댓글
@박응용님 ``` <div class="col-auto"> <a class="btn btn-primary" th:href="@{|/question/detail/${question.id}?page=${paging.number}&sort=createDate|}">최신순</a> <a class="btn btn-primary" th:href="@{|/question/detail/${question.id}?page=${paging.number}&sort=voter|}">추천순</a> </div> ``` 템플릿에 코드를 이렇게 바꿔서 해결했습니다, 타임리프 문법을 잘못 썼네요, 감사합니다! - buzz781님, 2022년 12월 22일 2:18 오전 추천 , 대댓글
목록으로