feat: 페이징 라벨을 MessageSource 로 가져오는 MessageSourcePaginationRenderer 추가 - #427
Merged
jei007 merged 1 commit intoSep 14, 2026
Merged
Conversation
페이징 렌더러의 [처음]/[이전]/[다음]/[마지막] 라벨은 렌더러 생성자에 한국어로 고정되어 있어 다국어 화면에서 로케일에 맞게 바꿀 수 없고, 라벨 템플릿을 바꾸려면 렌더러를 상속해 protected 필드를 덮어써야 한다. - MessageSourcePaginationRenderer(MessageSourceAware): 요청 로케일 기준으로 MessageSource 에서 pagination.link.first/previous/next/last 를 가져와 렌더링한다. 메시지가 없거나 MessageSource 가 없으면 기존 한국어 라벨과 같은 결과를 낸다. 라벨 문구의 작은따옴표·중괄호는 MessageFormat 에 안전하게 이스케이프한다 - AbstractPaginationRenderer: 라벨 6종 setter 와 라벨을 파라미터로 받는 protected doRender() 를 추가했다. renderPagination() 은 필드로 doRender() 를 호출하므로 기존 렌더러의 출력은 그대로다. 로케일마다 라벨이 달라지는 렌더러가 공유 필드를 바꾸지 않고(스레드 안전) 렌더링할 수 있다 MessageSourcePaginationRendererTest 6건 추가 — 영어 로케일 라벨 조회, 한국어 로케일 출력이 DefaultPaginationRenderer 와 동일, 메시지 없을 때 폴백, MessageSource 없이 동작, 특수문자 라벨의 리터럴 렌더링, setter 로 라벨 교체.
jei007
approved these changes
Sep 14, 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
수정된 소스 내용 Modified source
배경
페이징 렌더러의 [처음]/[이전]/[다음]/[마지막] 라벨은
DefaultPaginationRenderer생성자에 한국어로 고정되어 있어다국어 화면에서 로케일(Locale)에 맞게 바꿀 수 없습니다. 라벨 템플릿을 바꾸려면 렌더러를 상속해 protected 필드를 덮어써야
하고, 렌더러는 싱글톤 빈이라 요청마다 라벨을 바꾸는 방식은 스레드 안전하지 않습니다.
변경한 것
1.
pagination/MessageSourcePaginationRenderer신규 —AbstractPaginationRenderer+MessageSourceAwareLocaleContextHolder) 기준으로MessageSource에서pagination.link.first/.previous/.next/.last를 가져온다MessageSource가 주입되지 않으면 기존 한국어 라벨과 같은 결과MessageFormat에 안전하게 이스케이프. 라벨은 렌더링 시점의 지역 변수로만 다룬다2.
AbstractPaginationRenderer— 라벨 setter 6종 +protected doRender(...)renderPagination()은 이제 필드 6개를 넘겨doRender()를 호출합니다. 출력은 그대로이며, 로케일마다 라벨이 달라지는렌더러가 공유 필드를 바꾸지 않고 렌더링할 수 있는 지점입니다. setter 는 XML 설정으로 기존 렌더러의 라벨 템플릿을 바꿀 수
있게 합니다(상속 불필요).
호환성
DefaultPaginationRenderer와 완전히 같음을테스트로 확인했습니다.
renderPagination()을 오버라이드한 하위 클래스가 있어도 그 오버라이드가 그대로 적용됩니다.AbstractKrdsPaginationRenderer는 별개 계층(PaginationRenderer직접 구현)이라 건드리지 않았습니다.JUnit 테스트 JUnit tests
MessageSourcePaginationRendererTest6건 신규,ptl.mvc모듈 전건 통과.Tests run: 48, Failures: 0, Errors: 0, Skipped: 0Tests run: 48, Failures: 0, Errors: 0, Skipped: 0DefaultPaginationRenderer와 완전히 같다MessageSource없이도 동작Suivant {1} d'accord같은 라벨이 그대로 렌더링된다DefaultPaginationRenderer의 라벨 템플릿을 setter 로 교체수동 확인: 현재
main(cc2b332) 위에서ptl.mvc모듈 빌드·테스트가 통과함을 Windows 와 Linux 에서 확인했습니다.테스트 브라우저 Test Browser
해당 없음 — 렌더링 결과 문자열은 JUnit 으로 검증했습니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
해당 없음 — 위 JUnit 테스트 결과로 갈음합니다.
base:
eGovFramework:main@cc2b332(2026-09-10 fetch 기준, #366~#379 머지 후) · 단일 커밋