반응형 AJAX2 [Spring Boot] spring security - CSRF 적용 , +) ajax csrf 적용 1. gradle 혹은 maven에 'spring-boot-starter-security' 추가 implementation 'org.springframework.boot:spring-boot-starter-security' org.springframework.boot spring-boot-starter-security 2.5.5 Spring Security는 스프링 기반의 어플리케이션 보안을 담당하는 프레임워크로 Spring Security를 사용하면 보안처리를 간단하면서 강력하게 구현가능하다! 2. XXXXApplication.java에 @EnableWebSecurity 선언 @EnableWebSecurity :Spring Security를 활성화 @EnableWebSecurity @SpringBoot.. 2021. 12. 7. [Ajax] 파일 file 다운로드 받기 결론부터 말하자면 xhr.responseType = "blob" 로 설정해야 한다! 기존에 사용하던 제이쿼리 버전이 1.11.1이였는데 이 버전은 blob이 적용안되더라.. 버전 문제인줄 모르고 한참을 씨름 했는데 3.6.0으로 올리니까 해결됐다. (어떤 버전부터 되는 건지는 모르겠음) 아래 예시 참조!! let options = { url: "[[@{/}]]download" , beforeSubmit : loadingAjaxImage , contentType: "application/x-www-form-urlencoded;charset=UTF-8" , xhr: function () { let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function .. 2021. 11. 30. 이전 1 다음 728x90 반응형