{"id":1443,"date":"2020-11-08T12:38:17","date_gmt":"2020-11-08T03:38:17","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1443"},"modified":"2020-11-12T21:46:09","modified_gmt":"2020-11-12T12:46:09","slug":"%ec%97%90%eb%9f%ac-%ed%8e%98%ec%9d%b4%ec%a7%80-%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1443","title":{"rendered":"\uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815"},"content":{"rendered":"<h1>\uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815<\/h1>\n<h2>\ub514\ud3f4\ud2b8 \uc5d0\ub7ec\ud398\uc774\uc9c0 \uc124\uc815<\/h2>\n<p>\ub2e8\uc21c\ud788 <code>resources\/static\/error<\/code> \ud3f4\ub354\uc5d0 \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\ub294 \uac83\ub9cc\uc73c\ub85c \uc5d0\ub7ec\ud398\uc774\uc9c0\ub97c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud30c\uc77c\uba85\uc740 \uc5d0\ub7ec\ucf54\ub4dc\uc640 \uc77c\uce58\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/wp-content\/uploads\/2020\/11\/20201108-01.png\"><img decoding=\"async\" src=\"https:\/\/www.skyer9.pe.kr\/wordpress\/wp-content\/uploads\/2020\/11\/20201108-01.png\" alt=\"\" \/><\/a><\/p>\n<h2>\ucee4\uc2a4\ud140 \uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815<\/h2>\n<p><strong>\ucee4\uc2a4\ud140 \uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815\ubcf4\ub2e4\ub294 <code>ControllerAdvice<\/code> \uac00 \uc88b\uc740 \ub4ef \ud569\ub2c8\ub2e4.<\/strong><\/p>\n<p>\uc544\ub798\ucc98\ub7fc \ucee8\ud2b8\ub864\ub7ec\ub97c \uc0dd\uc131\ud574\uc11c \ucee4\uc2a4\ud140 \uc5d0\ub7ec\ud398\uc774\uc9c0\ub97c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">@Controller\npublic class CustomErrorController implements ErrorController {\n\n    private final String VIEW_PATH = &quot;\/error\/&quot;;\n\n    @RequestMapping(value = &quot;\/error&quot;)\n    public String handleError(HttpServletRequest request) {\n        Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);\n\n        if(status != null){\n            int statusCode = Integer.parseInt(status.toString());\n\n            if(statusCode == HttpStatus.FORBIDDEN.value()){\n                return VIEW_PATH + &quot;403.html&quot;;\n            }\n            if(statusCode == HttpStatus.NOT_FOUND.value()){\n                return VIEW_PATH + &quot;404.html&quot;;\n            }\n            if(statusCode == HttpStatus.INTERNAL_SERVER_ERROR.value()){\n                return VIEW_PATH + &quot;500.html&quot;;\n            }\n        }\n        return VIEW_PATH + &quot;error.html&quot;;\n    }\n\n    @Override\n    @SuppressWarnings( &quot;deprecation&quot; )\n    public String getErrorPath() {\n        return null;\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815 \ub514\ud3f4\ud2b8 \uc5d0\ub7ec\ud398\uc774\uc9c0 \uc124\uc815 \ub2e8\uc21c\ud788 resources\/static\/error \ud3f4\ub354\uc5d0 \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\ub294 \uac83\ub9cc\uc73c\ub85c \uc5d0\ub7ec\ud398\uc774\uc9c0\ub97c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud30c\uc77c\uba85\uc740 \uc5d0\ub7ec\ucf54\ub4dc\uc640 \uc77c\uce58\ud574\uc57c \ud569\ub2c8\ub2e4. \ucee4\uc2a4\ud140 \uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815 \ucee4\uc2a4\ud140 \uc5d0\ub7ec \ud398\uc774\uc9c0 \uc124\uc815\ubcf4\ub2e4\ub294 ControllerAdvice \uac00 \uc88b\uc740 \ub4ef \ud569\ub2c8\ub2e4. \uc544\ub798\ucc98\ub7fc \ucee8\ud2b8\ub864\ub7ec\ub97c \uc0dd\uc131\ud574\uc11c \ucee4\uc2a4\ud140 \uc5d0\ub7ec\ud398\uc774\uc9c0\ub97c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. @Controller public class CustomErrorController implements ErrorController { private final String VIEW_PATH = &quot;\/error\/&quot;; @RequestMapping(value\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1443\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1443","post","type-post","status-publish","format-standard","hentry","category-spring-boot-2-1"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1443"}],"version-history":[{"count":3,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions"}],"predecessor-version":[{"id":1461,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions\/1461"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}