본문 바로가기 메뉴 바로가기

How to be awesome

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

How to be awesome

검색하기 폼
  • 분류 전체보기 (145)
    • Java (32)
    • Algorithm (26)
    • JSP & Servlet (0)
    • Spring Framework (14)
    • Git & Github (6)
    • Database (11)
    • Linux (3)
    • Design Pattern (12)
    • JPA (7)
    • Project (14)
    • JavaScript (4)
    • Development (10)
    • HTML&CSS (1)
    • AWS (5)
  • 방명록

크로스오리진 (1)
스프링 부트에서 CORS 문제 해결하기

방법1. 특정 컨트롤러나 요청에 대해서 Cross Origin 허용하기 @CrossOrigin 애노테이션 사용하기 @RestController @CrossOrigin(origins = "http://localhost:63342") //해당 origin 승인하기 @RequestMapping("/api/books") public class VocaTestApiController { ... } 방법2. 전역설정을 통해서 Cross Origin 허용하기 WebMvcConfigurer의 addCorsMappings 메소드 활용하기 import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.con..

Spring Framework 2019. 10. 19. 15:31
이전 1 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바