• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    해결됨

게시글 조회 4 - 페이징 처리

23.05.14 23:18 작성 23.05.14 23:19 수정 조회수 268

0

<Post>

<PostResponse>

<PostService>

<PostController>

<PostControllerTest>

 

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property 'desc' found for type 'Long'; Traversed path: Post.id

안녕하세요 호돌님 PostControllerTest에서 페이지size와 정렬방법 설정의 "/posts page=1&size=5"은 정상 작동하는데 &sort=id.desc를 작성하면 위와 같은 오류가 발생하는데 뭐가 잘못된건지 모르겠습니다ㅠ

답변 1

답변을 작성해보세요.

1

안녕하세요. 호돌맨입니다.
질문을 남겨주셔서 감사합니다.

&sort=id.desc 가 아니라 &sort=id,desc 로 해보시겠습니까? (마침표가 아닌 쉼표)

감사합니다.

nose딩님의 프로필

nose딩

질문자

2023.05.15

헉 영상 계속 돌려볼땐 몰랐는데 다시 보니까 쉼표라고 언급도 하셨네요ㅠㅠ 너무 죄송합니다

답변 감사드려요!