Ver Fonte

[ST24PRJ-542] gagaframework AJAX 호출여부 체크 추가 주석 처리

card007 há 4 anos atrás
pai
commit
b9785d166f

+ 13 - 17
src/main/java/com/style24/core/support/controller/TscBaseController.java

@@ -5,8 +5,6 @@ import java.sql.SQLException;
 import java.sql.SQLRecoverableException;
 import java.util.Set;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolation;
 import javax.validation.Validation;
 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.ModelAttribute;
 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.gagaframework.web.rest.exception.GagaRestException;
@@ -133,19 +129,19 @@ public class TscBaseController {
 		}
 
 		// 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
 
 		if (throwable instanceof SQLException || throwable instanceof BindingException