|
@@ -5,8 +5,6 @@ import java.sql.SQLException;
|
|
|
import java.sql.SQLRecoverableException;
|
|
import java.sql.SQLRecoverableException;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.ConstraintViolation;
|
|
import javax.validation.ConstraintViolation;
|
|
|
import javax.validation.Validation;
|
|
import javax.validation.Validation;
|
|
|
import javax.validation.Validator;
|
|
import javax.validation.Validator;
|
|
@@ -24,8 +22,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
import org.springframework.web.bind.annotation.InitBinder;
|
|
import org.springframework.web.bind.annotation.InitBinder;
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
|
-import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
|
|
import com.gagaframework.web.rest.exception.GagaRestException;
|
|
import com.gagaframework.web.rest.exception.GagaRestException;
|
|
@@ -133,19 +129,19 @@ public class TscBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Ajax 호출인지 여부를 체크. 2021.11.16. gagamel
|
|
// Ajax 호출인지 여부를 체크. 2021.11.16. gagamel
|
|
|
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
- String reqWith = request.getHeader("x-requested-with");
|
|
|
|
|
-
|
|
|
|
|
- if (StringUtils.isBlank(reqWith) || !"XMLHttpRequest".equals(reqWith)) {
|
|
|
|
|
- HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- // 에러 페이지로 forwarding
|
|
|
|
|
- request.getRequestDispatcher("/error").forward(request, response);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- // Do nothing
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
+ // String reqWith = request.getHeader("x-requested-with");
|
|
|
|
|
+ //
|
|
|
|
|
+ // if (StringUtils.isBlank(reqWith) || !"XMLHttpRequest".equals(reqWith)) {
|
|
|
|
|
+ // HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
|
|
+ //
|
|
|
|
|
+ // try {
|
|
|
|
|
+ // // 에러 페이지로 forwarding
|
|
|
|
|
+ // request.getRequestDispatcher("/error").forward(request, response);
|
|
|
|
|
+ // } catch (Exception e) {
|
|
|
|
|
+ // // Do nothing
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
// Ajax 호출인지 여부를 체크. 2021.11.16. gagamel
|
|
// Ajax 호출인지 여부를 체크. 2021.11.16. gagamel
|
|
|
|
|
|
|
|
if (throwable instanceof SQLException || throwable instanceof BindingException
|
|
if (throwable instanceof SQLException || throwable instanceof BindingException
|