Repository navigation
fix: 에러 화면이 삭제된 메시지 코드를 참조해 화면 대신 예외가 뜨는 문제 수정 - #46
Merged
jei007 merged 1 commit intoSep 3, 2026
Merged
Conversation
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.
문제
에러 화면 두 개가
fc0f784(v5.0.0) 에서 삭제된 자원을 아직 참조합니다.common/error.jsp: 메시지 코드image.errorBg, 스타일시트/css/egovframework/sample.csscmmn/dataAccessFailure.jsp: 메시지 코드fail.common.sqlfc0f784는message-common번들 세 개 모두에서 두 코드를 지웠고sample.css도 같이 지웠습니다.spring:message는 코드를 찾지 못하면JspTagException을 던집니다. 이 프로젝트에는useCodeAsDefaultMessage설정이 없고 두 태그에text=폴백도 없습니다.그래서 오류를 보여줄 화면이 스스로 예외를 냅니다.
web.xml의error-page세 항목(java.lang.Throwable,404,500)이 전부/common/error.jsp를 가리키므로 어떤 오류가 나든 사용자에게 앱 화면이 가지 않습니다.mvn package로 만든 WAR 를tomcat:10.1-jdk17-temurin에 올려 받은 응답입니다.컨테이너 로그에 남은 원인입니다.
세 번째 요청은
name을SAMPLE.NAME의VARCHAR(50)보다 길게 넣은 것입니다.SimpleMappingExceptionResolver가DataAccessException을cmmn/dataAccessFailure로 보내는데 그 화면이 예외를 내고, 그 예외가 다시/common/error.jsp로 가서 또 예외를 냅니다.삭제된 코드를 되살리지 않은 이유
image.errorBg는 문구가 아니라 같은 커밋이 지운sample.css의 클래스명이었고,fail.common.sql은 JSP 가 넘기지 않는 인자를 담고 있어 되살리면{0}·{1}이 그대로 나옵니다. 같은 커밋이 남긴fail.common.msg는 형제 에러 화면 셋(egovBizException.jspegovError.jsptransactionFailure.jsp)이 모두 쓰고 있어 두 화면도 거기 맞췄습니다.수정
cmmn/dataAccessFailure.jsp:fail.common.sql을fail.common.msg로 교체common/error.jsp: 삭제된sample.css링크 제거,td의class속성 제거, 비어 있던span에fail.common.msg출력.c:url이 없어져 쓰이지 않게 된ctaglib 선언도 함께 제거번들에 없는 코드를 참조하는 화면은 이 두 개입니다.
JUnit 테스트 JUnit tests
테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.
EgovErrorViewResourceTest를 함께 넣었습니다. 에러 화면 JSP 다섯 개를 읽어 각spring:message코드를message-common번들로 한국어와 영어 양쪽에서 실제로 해석해 보고,c:url로 링크한 정적 자원이src/main/webapp아래 있는지 확인합니다.수정 전에는 다섯 항목을 전부 지목하며 실패합니다. 경로만 줄여 옮깁니다.
수정 후에는 통과합니다.
pom.xml의 surefireskipTests가true로 고정돼 있어 그대로는 실행되지 않으니, 확인하실 때 그 값만 내려 주십시오.같은 실행에서
EgovSampleControllerTestAddSampleTest가HV000183(EL 의존성) 으로 실패하는데, 이 수정과 무관하게 현재 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.
스크린샷 대신 같은 컨테이너에서 수정 후에 받은 응답을 옮깁니다.
404 는 404 그대로이고
dataAccessFailure의 200 도SimpleMappingExceptionResolver에statusCode가 없어 원래 그런 값입니다. 이 수정이 바꾼 것은 상태 코드가 아니라 그려지지 않던 화면이 그려진다는 점입니다.