diff --git a/src/main/java/cokr/xit/foundation/web/ExceptionController.java b/src/main/java/cokr/xit/foundation/web/ExceptionController.java index 4ea97ac..def21a2 100644 --- a/src/main/java/cokr/xit/foundation/web/ExceptionController.java +++ b/src/main/java/cokr/xit/foundation/web/ExceptionController.java @@ -29,13 +29,14 @@ public class ExceptionController extends AbstractController { } protected ModelAndView toErrorPage(HttpServletRequest hreq, Object status, String msgKey) { - return new ModelAndView("error/errorPage") + Object disp = hreq.getRequestDispatcher("error/errorPage"); + String viewName = disp != null ? "error/errorPage" : "jsonView" ; + return new ModelAndView(viewName) .addObject("json", ajaxRequest() || jsonResponse()) .addObject("path", getAction(hreq)) .addObject("failed", true) .addObject("status", status) - .addObject("message", message(msgKey)) - ; + .addObject("message", message(msgKey)); } /**pageNotFound 오류의 처리를 위한 정보를 갖는 ModelAndView를 반환한다.