Merge remote-tracking branch 'origin/dev' into dev

main
Kurt92 2 years ago
commit 9957b1170a

@ -2,11 +2,13 @@ package kr.xit.framework.support.exception.resolver;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -36,11 +38,24 @@ public class AjaxExceptionViewResolver extends AbstractExceptionViewResolver {
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream pinrtStream = new PrintStream(out); PrintStream pinrtStream = new PrintStream(out);
exception.printStackTrace(pinrtStream);
String stackTraceString = "";
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);
String stackTraceString = "";
tempMap.put("result", false); tempMap.put("result", false);
exception.printStackTrace(pinrtStream);
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
// Duplicate exception
if(exception instanceof SQLIntegrityConstraintViolationException
|| exception instanceof DataIntegrityViolationException){
tempMap.put("message", "요청 처리에 실패하였습니다[이미 등록된 데이타 요청]");
}else{
if(Globals.IS_SP_ALERT_MSG){
exception.printStackTrace(pinrtStream);
stackTraceString = out.toString();
}
}
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);

@ -2,11 +2,13 @@ package kr.xit.framework.support.exception.resolver;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.AjaxMessageMapRenderer;
@ -26,19 +28,33 @@ public class NormalExceptionViewResolver extends AbstractExceptionViewResolver {
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream pinrtStream = new PrintStream(out); PrintStream pinrtStream = new PrintStream(out);
exception.printStackTrace(pinrtStream);
String stackTraceString = ""; String stackTraceString = "";
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);
exception.printStackTrace(pinrtStream);
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
// Duplicate exception
if(exception instanceof SQLIntegrityConstraintViolationException
|| exception instanceof DataIntegrityViolationException){
tempMap.put("message", "요청 처리에 실패하였습니다[이미 등록된 데이타 요청]");
}else{
if(Globals.IS_SP_ALERT_MSG){
exception.printStackTrace(pinrtStream);
stackTraceString = out.toString();
}
}
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"));
mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, tempMap); mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, tempMap);
// mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, AjaxMessageMapRenderer.error(errorCode, errorArguments)); // mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, AjaxMessageMapRenderer.error(errorCode, errorArguments));
Map<String, Object> errorMessage = AjaxMessageMapRenderer.error(errorCode, errorArguments);
logger.error(new StringBuffer().append("error_code : {}\n").append("error_message : {}").toString(),
new Object[]{ errorCode, errorMessage}); logger.error("error_code : {}\n" + "error_message : {}",
new Object[]{ errorCode, tempMap});
return mav; return mav;
} }

@ -127,7 +127,7 @@ fail.common.loginIncorrect = [{0}] \uD68C \uC774\uC0C1 \uB85C\uADF8\uC778 \uC811
fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558) fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558)
fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.request.msg = \uC694\uCCAD\uCC98\uB9AC\uB97C \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4. fail.request.msg = \uC694\uCCAD \uCC98\uB9AC\uC5D0 \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4.
fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4. fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
#UI User Message# #UI User Message#

@ -127,7 +127,7 @@ fail.common.loginIncorrect = [{0}] \uD68C \uC774\uC0C1 \uB85C\uADF8\uC778 \uC811
fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558) fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558)
fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.request.msg = \uC694\uCCAD\uCC98\uB9AC\uB97C \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4. fail.request.msg = \uC694\uCCAD \uCC98\uB9AC\uC5D0 \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4.
fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4. fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
#UI User Message# #UI User Message#

Loading…
Cancel
Save