Repository navigation
fix(sample): 목록 화면 히든 pageIndex 하드코딩 수정(글 조회 후 페이지 위치 복원) - #45
Merged
jei007 merged 1 commit intoSep 3, 2026
Merged
Conversation
4 of 13 tasks
jei007
approved these changes
Sep 3, 2026
jei007
left a comment
Contributor
There was a problem hiding this comment.
표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
수정 사유 Reason for modification
소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)
수정된 소스 내용 Modified source
검토자를 위해 수정된 소스 내용을 설명해 주세요. Please describe the modified source for reviewers.
문제
egovSampleList.jsp의listForm히든pageIndex가 상수1을 내보냅니다.목록 3페이지에서 글을 열고 목록으로 돌아오면 항상 1페이지가 나옵니다.
EgovSampleController는pageIndex를 세 경로에서 모두 되돌려 줍니다.updateSampleView는detail.setPageIndex(sampleVO.getPageIndex())로,updateSample과deleteSample은redirectAttributes.addAttribute("pageIndex", ...)로 되돌립니다. 화면이 그 값을 받지 않아 왕복이 끊깁니다.같은 화면 안에서도 어긋납니다. 같은 폼의
searchCondition과searchKeyword는${sampleVO...}로 복원하는데pageIndex만 상수이고, 같은 응답의 No 컬럼은${sampleVO.pageIndex}로 3페이지 번호를 그리는데 히든 필드는1을 내보냅니다.fc0f784(v5.0.0, KRDS 디자인 적용) 에서<form:hidden path="pageIndex" />가 지금의 상수 입력으로 바뀌었습니다. 같은 커밋이<form:select path="searchCondition">과<form:input path="searchKeyword">는 수동 태그에${sampleVO...}를 붙여 복원을 유지했고,updateSampleView의set...호출과redirectAttributes전환도 이 커밋에서 들어왔습니다. 왕복을 새로 세우면서 목록 화면만 복원식을 받지 못한 것으로 보입니다.수정
히든 필드 한 줄을 같은 폼의 다른 필드 및
egovSampleRegister.jsp와 동일한 형태로 맞췄습니다.페이지 링크는
fn_egov_link_page가 제출 직전에 이 히든 값을 덮어쓰므로 영향이 없습니다.알려진 부수효과
이 수정 뒤에는 3페이지에서 검색하면
pageIndex=3이 함께 전송되어, 결과가 3페이지에 못 미치면 빈 목록이 나옵니다.지금은 히든이 상수라 검색이 늘 1페이지로 리셋됩니다. 다만 그 리셋은
fc0f784이전에는 없던 동작입니다. 부모 커밋b24dc50의 같은 JSP 도<form:hidden path="pageIndex" />로 페이지를 유지하고fn_egov_selectList에 리셋이 없으며,egovframe-hands-on-guide의 lab14-1 실습 소스도 같습니다.검색 시 1페이지로 되돌리는 편이 낫다고 보시면
fn_egov_selectList()에document.listForm.pageIndex.value = 1;한 줄을 더하면 됩니다. 이번 수정이 다루는 왕복 문제와는 별개 결정이라 넣지 않았습니다. 함께 반영하는 편이 좋겠다고 하시면 이 PR 에 추가하겠습니다.EgovSampleListJspPageIndexTest도 함께 넣었습니다. 히든 필드 한 줄만 남기는 편을 선호하시면 빼겠습니다.JUnit 테스트 JUnit tests
테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.
EgovSampleListJspPageIndexTest는 수정 전에는 실패하고 수정 후에는 통과합니다. 같은 실행에서EgovSampleControllerTestAddSampleTest가Failed to load ApplicationContext (activeProfiles = ["mysql", "dummy"])로 오류를 내는데, 이 수정과 무관하게 현재 main 에서도 동일하게 발생하는 선행 오류입니다.테스트 브라우저 Test Browser
테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.
브라우저 대신 세션 쿠키를 유지하는 명령행 HTTP 클라이언트로 화면 왕복을 확인했습니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
테스트 전과 후의 스크린샷 또는 캡처 영상을 이곳에 첨부해 주세요. Please attach screenshots or video captures of your before and after tests here.
스크린샷 대신 실제 응답에서 뽑은 값을 옮깁니다.
mvn package로 만든 WAR 를tomcat:10.1-jdk17-temurin에 올려 확인했습니다.수정 전
수정 후