본문 바로가기

Spring

(3)
WebClient: 기본 헤더 설정을 Consumer 를 이용하기(Java/Kotlin) Java WebClient 에 공통적으로 사용하는 헤더가 있다면 defaultHeader 를 이용하여 설정해놓으면 매번 WebClient 사용할 때마다 설정할 필요가 없어진다. WebClient webClient = WebClient.builder() .baseUrl("http://markbucciarelli.com") .defaultHeader("Authorization", "Bearer 7e0af818e0564a238bbcf6b9a0f7c176") .build(); Authorization 는 알려져 있는 헤더이므로 org.springframework.http 패키지의 HttpHeaders 클래스의 상수에 이미 정의되어 있다. package org.springframework.http; public ..
스프링(Spring)-pom.xml Maven 정리 (pom.xml)org.json Group Id: org.json Artifact Id: json Version: 20090211ref) http://mvnrepository.com/artifact/org.json/json/20090211org.json.simple Group Id: com.googlecode.json-simple Artifact Id: json-simple Version: 1.1 c3p0 Group Id: c3p0 Artifact Id: c3p0 Version: 0.9.1.2commons-dbcp Group Id: commons-dbcp Artifact Id: commons-dbcp Version: 1.4 mybatis-spring Group Id: org.mybatis..
[Spring] 의존성관리(dependency management) 스프링의 템플릿으로 기본 프로젝트를 생성했는데, 빨간색으로 글씨가 난리도 아니다. 그리고 Run As > Run on Server 를 수행했더니 에러가 뜬다. 찾아보니 스프링이 돌아가기 위한 jar 라이브러리들이 없어서 그런 것이란다.이클립스에는 pom.xml에 의해 자동으로 의존성을 처리해주는 기능이 있는데 기본으로 꺼져있다고 한다.최신의 플러그인이라면프로젝트 Properies > Spring > Dependency Management 에서 "Automatically update dependencies from Maven pom.xml"에 체크를 해주면 된다고 한다. 좀 오래된 버전을 사용한다면 위치는 조금 달라진다고 한다.프로젝트 Properies > Java EE Module Dependencies..