diff --git a/src/main/webapp/WEB-INF/jsp/error/errorPage.jsp b/src/main/webapp/WEB-INF/jsp/error/errorPage.jsp new file mode 100644 index 00000000..6e662796 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/error/errorPage.jsp @@ -0,0 +1,82 @@ +<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +<%@ page import="java.util.HashMap, javax.servlet.http.HttpServletRequest, cokr.xit.foundation.data.Convert" %> +<%! private static final HashMap titles = new HashMap<>(); + + static { + titles.put("404", "Page Not Found"); + titles.put("sessionExpired", "Session Expired"); + titles.put("invalidSession", "Invalid Session"); + titles.put("accessDenied", "Access Denied"); + titles.put("500", "Server Error"); + } + + private static void setTitle(HttpServletRequest hreq) { + String status = Convert.toString(hreq.getAttribute("status")); + if (status == "") + status = "500"; + String title = titles.get(status); + if (title == null) + title = titles.get("500"); + hreq.setAttribute("title", title); + } +%> +<% setTitle(request); %> +<% + response.setContentType("application/json; charset=UTF-8"); + String stacktrace = (String)request.getAttribute("stacktrace"); + request.setAttribute("stacktrace", Convert.rntq(stacktrace)); +%>{ + "path": "${path}", + "failed": true, + "status": "${status}", + "title": "${title}", + "message": "${message}", + "description": "${description}", + "stacktrace": "${stacktrace}" +} +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + + + + + + +
+
+

${title} :(

+

죄송합니다. 😖

+

${message}

+ 처음으로 돌아가기 + 이전으로 돌아가기 +
+ " + alt="page-misc-error-light" + width="500" + class="img-fluid" + data-app-dark-img="illustrations/page-misc-error-dark.png" + data-app-light-img="illustrations/page-misc-error-light.png" + /> +
+
+
+ + + + + + + +
diff --git a/src/main/webapp/WEB-INF/jsp/include/taglib.jsp b/src/main/webapp/WEB-INF/jsp/include/taglib.jsp new file mode 100644 index 00000000..19a0e603 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/include/taglib.jsp @@ -0,0 +1,4 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false" +%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" +%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" +%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> \ No newline at end of file