feat(redesign): 에러페이지 empty-state 외형 + 코드 분기
errer.jsp에 디자인 SVG 아이콘·.empty-state 외형 이식, 403/404/기타 3분기 확장. status_code scriptlet 코드읽기 방식과 isErrorPage·requestUri/message 상세 블록 보존(errorData EL 미채택). 뷰명 errer 유지. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
29182a3124
commit
d618087d0b
|
|
@ -1,4 +1,5 @@
|
||||||
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" isErrorPage="true" %>
|
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" isErrorPage="true" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
<%!
|
<%!
|
||||||
private String htmlEscape(Object value) {
|
private String htmlEscape(Object value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|
@ -67,81 +68,42 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.error-panel {
|
/* empty-state */
|
||||||
width: min(100%, 38rem);
|
.empty-state {
|
||||||
padding: 2rem;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 12px;
|
|
||||||
background: var(--card-bg);
|
|
||||||
box-shadow: 0 2px 8px var(--card-shadow);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
padding: 48px 24px;
|
||||||
|
max-width: 480px;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.error-panel__media {
|
.empty-state svg { display: block; margin: 0 auto; }
|
||||||
width: 8rem;
|
.empty-state .code {
|
||||||
height: 8rem;
|
display: block;
|
||||||
margin: 0 auto 1.5rem;
|
font-size: 12px;
|
||||||
border-radius: 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: linear-gradient(160deg, var(--card-media-1) 0%, var(--card-media-2) 45%, var(--card-media-3) 100%);
|
|
||||||
}
|
|
||||||
.error-panel__logo {
|
|
||||||
width: 5rem;
|
|
||||||
height: auto;
|
|
||||||
object-fit: contain;
|
|
||||||
opacity: 0.9;
|
|
||||||
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12));
|
|
||||||
}
|
|
||||||
html[data-theme="dark"] .error-panel__logo {
|
|
||||||
opacity: 0.94;
|
|
||||||
filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
|
|
||||||
}
|
|
||||||
.error-panel__eyebrow {
|
|
||||||
margin: 0 0 0.5rem;
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
letter-spacing: .1em;
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
letter-spacing: 0.02em;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
.error-panel__title {
|
.empty-state h3 {
|
||||||
margin: 0;
|
font-size: 1.35rem;
|
||||||
font-size: clamp(1.75rem, 4vw, 2.5rem);
|
font-weight: 800;
|
||||||
line-height: 1.2;
|
|
||||||
letter-spacing: 0;
|
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
|
margin: 8px 0 0;
|
||||||
}
|
}
|
||||||
.error-panel__description {
|
.empty-state p {
|
||||||
max-width: 28rem;
|
color: var(--text-muted);
|
||||||
margin: 1rem auto 0;
|
|
||||||
font-size: 0.9375rem;
|
font-size: 0.9375rem;
|
||||||
line-height: 1.65;
|
line-height: 1.65;
|
||||||
color: var(--text-muted);
|
margin: 12px 0 0;
|
||||||
}
|
}
|
||||||
.error-panel__meta {
|
.empty-actions {
|
||||||
margin: 1rem auto 0;
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 8px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
background: rgba(0, 0, 0, 0.025);
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
line-height: 1.5;
|
|
||||||
text-align: left;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
html[data-theme="dark"] .error-panel__meta {
|
|
||||||
background: rgba(255, 255, 255, 0.04);
|
|
||||||
}
|
|
||||||
.error-panel__actions {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 0.625rem;
|
gap: 10px;
|
||||||
margin-top: 1.5rem;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
.error-panel__button {
|
.btn {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -157,29 +119,42 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
.error-panel__button--primary {
|
.btn:hover {
|
||||||
|
border-color: rgba(232, 165, 75, 0.45);
|
||||||
|
box-shadow: 0 4px 12px var(--card-shadow);
|
||||||
|
}
|
||||||
|
.btn:active { transform: scale(0.98); }
|
||||||
|
.btn-primary {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: var(--button-text);
|
color: var(--button-text);
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
}
|
}
|
||||||
.error-panel__button:hover {
|
.btn-ghost {
|
||||||
border-color: rgba(232, 165, 75, 0.45);
|
border-color: var(--border);
|
||||||
box-shadow: 0 4px 12px var(--card-shadow);
|
background: transparent;
|
||||||
}
|
}
|
||||||
.error-panel__button:active {
|
/* error meta detail */
|
||||||
transform: scale(0.98);
|
.error-meta {
|
||||||
|
margin: 1rem auto 0;
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
background: rgba(0, 0, 0, 0.025);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: left;
|
||||||
|
word-break: break-word;
|
||||||
|
max-width: 400px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
html[data-theme="dark"] .error-meta {
|
||||||
|
background: rgba(255, 255, 255, 0.04);
|
||||||
}
|
}
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.page-main {
|
.page-main { align-items: flex-start; padding-top: 1.5rem; }
|
||||||
align-items: flex-start;
|
.btn { width: 100%; }
|
||||||
padding-top: 1.5rem;
|
|
||||||
}
|
|
||||||
.error-panel {
|
|
||||||
padding: 1.5rem 1rem;
|
|
||||||
}
|
|
||||||
.error-panel__button {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -193,25 +168,53 @@
|
||||||
if (message == null || String.valueOf(message).isBlank()) {
|
if (message == null || String.valueOf(message).isBlank()) {
|
||||||
message = exception != null ? exception.getMessage() : null;
|
message = exception != null ? exception.getMessage() : null;
|
||||||
}
|
}
|
||||||
|
int code = (statusCode != null) ? (Integer) statusCode : 0;
|
||||||
%>
|
%>
|
||||||
<main class="page-main">
|
<main class="page-main">
|
||||||
<section class="error-panel" aria-labelledby="error-title">
|
<div class="empty-state">
|
||||||
<div class="error-panel__media" aria-hidden="true">
|
<% if (code == 403) { %>
|
||||||
<img class="error-panel__logo" src="<%= ctx %>/images/logo.png" alt="" width="120" height="120" />
|
<svg width="86" height="86" viewBox="0 0 86 86" fill="none" aria-hidden="true">
|
||||||
|
<rect x="24" y="38" width="38" height="30" rx="6" fill="#FBEFD6" stroke="#D4A853" stroke-width="2.5"/>
|
||||||
|
<path d="M31 38v-7a12 12 0 0 1 24 0v7" fill="none" stroke="#D4A853" stroke-width="2.5"/>
|
||||||
|
<circle cx="43" cy="50" r="4" fill="#D4A853"/>
|
||||||
|
<line x1="43" y1="54" x2="43" y2="60" stroke="#D4A853" stroke-width="2.5" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
<span class="code">ERROR 403</span>
|
||||||
|
<h3>로그인이 필요한 페이지예요</h3>
|
||||||
|
<p>이 작업은 로그인한 회원만 가능합니다. 로그인 후 다시 시도해 주세요.</p>
|
||||||
|
<div class="empty-actions">
|
||||||
|
<a class="btn btn-primary" href="<%= ctx %>/login">로그인</a>
|
||||||
|
<a class="btn btn-ghost" href="<%= ctx %>/">홈으로</a>
|
||||||
|
</div>
|
||||||
|
<% } else if (code == 404) { %>
|
||||||
|
<svg width="86" height="86" viewBox="0 0 86 86" fill="none" aria-hidden="true">
|
||||||
|
<circle cx="40" cy="40" r="20" fill="#FBEFD6" stroke="#D4A853" stroke-width="2.5"/>
|
||||||
|
<line x1="54" y1="54" x2="68" y2="68" stroke="#D4A853" stroke-width="3" stroke-linecap="round"/>
|
||||||
|
<line x1="33" y1="40" x2="47" y2="40" stroke="#D4A853" stroke-width="2.5" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
<span class="code">ERROR 404</span>
|
||||||
|
<h3>페이지를 찾을 수 없어요</h3>
|
||||||
|
<p>주소가 바뀌었거나 삭제된 페이지일 수 있어요. 주소를 확인하거나 홈으로 돌아가 주세요.</p>
|
||||||
|
<div class="empty-actions">
|
||||||
|
<a class="btn btn-primary" href="<%= ctx %>/">홈으로</a>
|
||||||
|
<a class="btn btn-ghost" href="javascript:history.back()">이전 페이지</a>
|
||||||
</div>
|
</div>
|
||||||
<p class="error-panel__eyebrow">
|
|
||||||
<% if (statusCode != null) { %>
|
|
||||||
ERROR <%= statusCode %>
|
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
ERROR
|
<svg width="86" height="86" viewBox="0 0 86 86" fill="none" aria-hidden="true">
|
||||||
|
<circle cx="43" cy="43" r="24" fill="#FBEFD6" stroke="#D4A853" stroke-width="2.5"/>
|
||||||
|
<line x1="43" y1="32" x2="43" y2="46" stroke="#D4A853" stroke-width="2.5" stroke-linecap="round"/>
|
||||||
|
<circle cx="43" cy="53" r="2" fill="#D4A853"/>
|
||||||
|
</svg>
|
||||||
|
<span class="code"><% if (statusCode != null) { %>ERROR <%= statusCode %><% } else { %>ERROR<% } %></span>
|
||||||
|
<h3>페이지를 불러오지 못했습니다</h3>
|
||||||
|
<p>요청을 처리하는 중 문제가 발생했습니다. 잠시 후 다시 시도하거나 홈으로 돌아가 다른 메뉴를 이용해 주세요.</p>
|
||||||
|
<div class="empty-actions">
|
||||||
|
<a class="btn btn-primary" href="<%= ctx %>/">홈으로 이동</a>
|
||||||
|
<a class="btn btn-ghost" href="javascript:history.back()">이전 페이지</a>
|
||||||
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</p>
|
|
||||||
<h1 class="error-panel__title" id="error-title">페이지를 불러오지 못했습니다</h1>
|
|
||||||
<p class="error-panel__description">
|
|
||||||
요청을 처리하는 중 문제가 발생했습니다. 잠시 후 다시 시도하거나 홈으로 돌아가 다른 메뉴를 이용해 주세요.
|
|
||||||
</p>
|
|
||||||
<% if (requestUri != null || message != null) { %>
|
<% if (requestUri != null || message != null) { %>
|
||||||
<div class="error-panel__meta" aria-label="오류 상세 정보">
|
<div class="error-meta" aria-label="오류 상세 정보">
|
||||||
<% if (requestUri != null) { %>
|
<% if (requestUri != null) { %>
|
||||||
<div>요청 경로: <%= htmlEscape(requestUri) %></div>
|
<div>요청 경로: <%= htmlEscape(requestUri) %></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
@ -220,11 +223,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="error-panel__actions">
|
|
||||||
<a class="error-panel__button error-panel__button--primary" href="<%= ctx %>/">홈으로 이동</a>
|
|
||||||
<a class="error-panel__button" href="javascript:history.back()">이전 페이지</a>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
</main>
|
</main>
|
||||||
<jsp:include page="/WEB-INF/views/footer.jsp"/>
|
<jsp:include page="/WEB-INF/views/footer.jsp"/>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue