오류 시 errorPage 유무에 대한 viewName 설정

master
mjkhan21 11 months ago
parent 6523eb8440
commit bb55273e0d

@ -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 .

Loading…
Cancel
Save