Index: core-module/src/main/java/egovframework/com/ext/jstree/support/mvc/GenericAbstractController.java =================================================================== diff -u -r65a85b6b3863a95c9bed6e6da7a19ae2a0906979 -r2a666b00f2c41ed79f6fd95f2a415ca63799544c --- core-module/src/main/java/egovframework/com/ext/jstree/support/mvc/GenericAbstractController.java (.../GenericAbstractController.java) (revision 65a85b6b3863a95c9bed6e6da7a19ae2a0906979) +++ core-module/src/main/java/egovframework/com/ext/jstree/support/mvc/GenericAbstractController.java (.../GenericAbstractController.java) (revision 2a666b00f2c41ed79f6fd95f2a415ca63799544c) @@ -9,11 +9,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import egovframework.com.ext.jstree.support.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.servlet.mvc.AbstractController; import org.springmodules.validation.commons.DefaultBeanValidator; import com.google.gson.Gson; @@ -22,7 +24,7 @@ import egovframework.com.cmm.EgovMessageSource; import egovframework.com.ext.jstree.support.util.ParameterParser; -public abstract class GenericAbstractController { +public abstract class GenericAbstractController extends AbstractController { @Resource(name = "egovMessageSource") EgovMessageSource egovMessageSource; @@ -57,10 +59,10 @@ Map map = new HashMap(); map.put("status", "Exception Catch"); Gson gson = new GsonBuilder().serializeNulls().create(); - out.println(gson.toJson(map)); - out.flush(); - out.close(); - return; + out.println(gson.toJson(map)); + out.flush(); + out.close(); + return; } @ExceptionHandler(RuntimeException.class) @@ -71,15 +73,20 @@ response.setHeader("Cache-Control", "must-revalidate, no-store, no-cache"); response.addHeader("Cache-Control", "post-check=0, pre-check=0"); response.setHeader("Pragma", "no-cache"); - response.setContentType("application/json; charset=UTF-8"); - PrintWriter out = response.getWriter(); - Map map = new HashMap(); - map.put("status", "RuntimeException Catch"); - Gson gson = new GsonBuilder().serializeNulls().create(); - out.println(gson.toJson(map)); - out.flush(); - out.close(); - return; + response.setContentType("application/json; charset=UTF-8"); + PrintWriter out = response.getWriter(); + Map map = new HashMap(); + map.put("status", "RuntimeException Catch"); + if(ex.getMessage().isEmpty()){ + map.put("message", ex.getClass().toString()); + }else{ + map.put("message", ex.getMessage()); + } + Gson gson = new GsonBuilder().serializeNulls().create(); + out.println(gson.toJson(map)); + out.flush(); + out.close(); + return; } }