[26강] 회원가입 - 공통 응답 Script 만들기

[26강] 회원가입 - 공통 응답 Script 만들기

package com.cos.photogramstart.util; public class Script { public static String back() { StringBuffer sb = new StringBuffer(); sb.append("

package com.cos.photogramstart.handler; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestController; import com.cos.photogramstart.handler.ex.CustomValidationException; import com.cos.photogramstart.util.Script; @RestController @ControllerAdvice public class ControllerExceptionHandler { @ExceptionHandler(CustomValidationException.class) public String validationException(CustomValidationException e) { return Script.back(e.getErrorMap().toString()); } }​

Ajax

from http://aszzoon.tistory.com/37 by ccl(A) rewrite - 2021-10-07 13:27:53