fix: Grid request error fix

main
minuk926 2 years ago
parent 4f78815ff2
commit 3d319b8c39

@ -40,6 +40,7 @@ public class AjaxExceptionViewResolver extends AbstractExceptionViewResolver {
String stackTraceString = ""; String stackTraceString = "";
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString(); if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments); Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments);
tempMap.put("result", false);
if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString); if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString);
else tempMap.put("message", tempMap.get("message")); else tempMap.put("message", tempMap.get("message"));
return new ModelAndView(getView(), tempMap); return new ModelAndView(getView(), tempMap);

@ -4,7 +4,7 @@ import kr.xit.framework.support.util.PropertyHelper;
public class Globals { public class Globals {
//public static final boolean IS_SP_ALERT_MSG = PropertyHelper.getBoolean("Globals.error.isAlert"); //public static final boolean IS_SP_ALERT_MSG = PropertyHelper.getBoolean("Globals.error.isAlert");
public static final boolean IS_SP_ALERT_MSG = false; public static final boolean IS_SP_ALERT_MSG = true;
public static final String JSON_RESULT_CODE= "code"; public static final String JSON_RESULT_CODE= "code";
public static final String JSON_RESULT_MESSAGE= "message"; public static final String JSON_RESULT_MESSAGE= "message";

@ -199,6 +199,19 @@
======================== */ ======================== */
findData : function(){ findData : function(){
console.log($('#frmSearch').serialize()) console.log($('#frmSearch').serialize())
// grid 에러 발생 처리
GRID.reloadData(); GRID.reloadData();
}, },
/* ======================== /* ========================

@ -157,11 +157,13 @@ const TuiGrid = {
console.log(`failResponse >>>>>>>>>>>>>>>>>> `,ev); console.log(`failResponse >>>>>>>>>>>>>>>>>> `,ev);
try { try {
var msg = JSON.parse(ev.xhr.response).message; //tui-grid 기본 format 메시지 var msg = JSON.parse(ev.xhr.response).message; //tui-grid 기본 format 메시지
if(fnIsEmpty(msg)) if(!msg) {
msg = JSON.parse(ev.xhr.response).resp.message; msg = JSON.parse(ev.xhr.response).resp.message;
if(!fnIsEmpty(msg)) }else {
alert(msg); alert(msg);
}
} catch (e) { } catch (e) {
console.error('TuiGrid::failResponse parsing error', e)
} }
}); });
// 오류가 발생한 경우 // 오류가 발생한 경우
@ -169,11 +171,13 @@ const TuiGrid = {
console.log(`errorResponse >>>>>>>>>>>>>>>>>> `,ev); console.log(`errorResponse >>>>>>>>>>>>>>>>>> `,ev);
try { try {
var msg = JSON.parse(ev.xhr.response).message; //tui-grid 기본 format 메시지 var msg = JSON.parse(ev.xhr.response).message; //tui-grid 기본 format 메시지
if(fnIsEmpty(msg)) if(!msg) {
msg = JSON.parse(ev.xhr.response).resp.message; msg = JSON.parse(ev.xhr.response).resp.message;
if(!fnIsEmpty(msg)) }else {
alert(msg); alert(msg);
}
} catch (e) { } catch (e) {
console.error('TuiGrid::errorResponse parsing error', e)
} }
}); });

Loading…
Cancel
Save