Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20210217] jQuery ajax error, (Spring) @ResponseBody, jsonView, 상속보다는 합성 #42

Open
JuHyun419 opened this issue Feb 17, 2021 · 0 comments

Comments

@JuHyun419
Copy link
Owner

JuHyun419 commented Feb 17, 2021

jQuery ajax error 처리..

success : function( result ) {
},
error : function( error ) {
}

// error : function( jqXHR, textStatus, errorThrown ) 선언
  • jqXHR
    • XMLHttpRequest Object의 집합
  • errorThrown
    • 케이스별 오류 처리 및 디버깅
error : function( jqXHR, textStatus, errorThrown ) {

// 아래와 같은 속성들을 가지고 있음
alert( jqXHR.status );
alert( jqXHR.statusText );
alert( jqXHR.responseText );
alert( jqXHR.readyState );
}

@responsebody, jsonView

  • 서버에서 JSON형식으로 리턴하는 친구들
  • jsonView는 일부 설정이 필요함(.xml 파일 등)
  • @responsebody는 해당 메서드 위에 어노테이션을 설정하면 됨
  • @RestController 어노테이션이 붙어있으면 @responsebody 어노테이션은 생략 가능

상속보다는 합성을 사용하라..


References

https://m.blog.naver.com/PostView.nhn?blogId=afidev&logNo=20184722536&proxyReferer=https:%2F%2Fwww.google.com%2F
https://okky.kr/article/289849
https://zorba91.tistory.com/17

@JuHyun419 JuHyun419 changed the title [20210217] jQuery ajax error, (Spring) @ResponseBody, jsonView [20210217] jQuery ajax error, (Spring) @ResponseBody, jsonView, 상속보다는 합성 Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant