파란하늘의 지식창고
article thumbnail
PropertyEditor를 사용한 Data Binding (in Spring Data Redis)
Study/Java 2021. 6. 14. 15:26

Spring Data Redis의 문서를 보다 보면 아래와 같은 예제가 보인다. // inject the template as ListOperations @Resource(name="redisTemplate") private ListOperations listOps; Spring Boot의 RedisAutoConfiguration에서는 RedisTemplate과 StringRedisTemplate bean을 자동 설정해주고 있다. @Bean @ConditionalOnMissingBean(name = "redisTemplate") @ConditionalOnSingleCandidate(RedisConnectionFactory.class) public RedisTemplate redisTemplate(Redi..

article thumbnail
Spring Boot Data Redis 사용해보기
Study/Java 2021. 6. 9. 14:48

Spring Boot 기반에서 Redis를 사용하는 방법 Spring Boot 2.5.0 기준으로 작성함 dependency 설정 org.springframework.boot spring-boot-starter-data-redis redis는 connectionFactory로 Lettuce와 Jedis 두 가지를 제공한다. default로 Lettuce를 제공하고 만약 Jedis를 사용하고 싶은 경우 아래처럼 설정하면 된다. org.springframework.boot spring-boot-starter-data-redis io.lettuce lettuce-core redis.clients jedis Bean 설정 Spring Boot의 RedisAutoConfiguration은 RedisTemplate..

Spring Boot 2.5 Release Notes
Study/Java 2021. 5. 26. 07:52

전체 Release Notes 목록은 이 곳에서 확인할 수 있습니다. https://luvstudy.tistory.com/tag/Release%20Notes Spring Boot 2.5 Release Notes spring-projects/spring-boot spring-projects/spring-boot Spring Boot. Contribute to spring-projects/spring-boot development by creating an account on GitHub. github.com Upgrading from Spring Boot 2.4 SQL Script DataSource Initialization 지원 schema.sql 및 data.sql script에 사용되는 근본적인 m..

Spring Reference Documentation 한글 번역
Study/Java 2021. 4. 13. 04:55

google이 번역을 참 잘해주긴 하지만 asciidoc으로 생성된 문서의 code tag가 있는 문장의 경우 code tag 부분은 번역을 하지 않으면서 번역이 깨지는 현상이 있다. code tag 영역을 번역하지 않는건 당연한 동작이지만 해당 tag의 위치가 깨지는 것 때문에 번역된 문장을 이해하기 힘든 경우가 많아 공부할 겸 간간히 구글 번역한 내용을 문서로 만들어두고 있다. 이후 문서 버전이 변경되는 경우 관리를 어떻게 할지는 아직 고민하지 않았지만 혹시 도움이 되는 경우가 있을까 싶어 이곳에 공유해본다. 번역해둔 챕터는 현재 아래와 같다. Spring Framework Testing Spring Boot Logging Testing luversof.github.io/bluesky-docs/ Bl..

Upgrading to Spring Framework 5.3
Study/Java 2020. 12. 1. 15:10

Upgrading to Spring Framework 5.x Upgrading to Spring Framework 5.x의 5.3 버전에 대한 내용을 번역한 글입니다. spring-projects/spring-framework spring-projects/spring-framework Spring Framework. Contribute to spring-projects/spring-framework development by creating an account on GitHub. github.com Upgrading to Version 5.3 Third-Party APIs and Libraries Kotlin의 경우 Kotlin 지원이 1.4로 업그레이드되었으며 여전히 Kotlin 1.3+과 호환됩니다...

What's New in Spring Framework 5.3
Study/Java 2020. 12. 1. 14:51

What's New in Spring Framework 5.x What's New in Spring Framework 5.x의 5.3 버전에 대한 내용을 번역한 글입니다. spring-projects/spring-framework spring-projects/spring-framework Spring Framework. Contribute to spring-projects/spring-framework development by creating an account on GitHub. github.com What's New in Version 5.3 General Core Revision ASM 9.0, Kotlin 1.4로 업그레이드합니다. ReactiveAdapterRegistry에서 RxJava 3을..

RestTemplate Generic responseType 사용
Study/Java 2020. 1. 28. 08:44

이전에 RestTemplate을 사용하면서 List 같은 Collection 형태로 반환받기 위한 방법에 대해 소개하는 글을 썼다. 2018/11/16 - [Study/Java] - RestTemplate list 반환하기 RestTemplate list 반환하기 요청을 반환받는 클래스가 다음과 같다고 가정한다. @Data public class ResultClass { private long idx; private String name; } List로 리턴 받는 방법 - 문제가 있음. 비추천 List list = restTe.. luvstudy.tistory.com 해당 방법은 ParameterizedTypeReference를 사용해서 리턴 값을 설정하는 방법인데 대략 다음과 같이 사용한다. List ..

Spring RestTemplate으로 요청 시 302 redirect 된 페이지의 response 결과받기
Study/Java 2019. 8. 9. 15:28

HttpStatus가 302 인 경우 브라우저에서는 해당 페이지로 리다이렉트 되어 화면이 처리된다. restTemplate으로 요청한 응답 결과의 HttpStatus가 302 인 경우는 해당 페이지로 리다이렉트 되지 않고 응답 결과만 반환받는다. 하지만 redirect된 결과로 응답을 받을 수 있는 기능이 있다. restTemplate에서 requestFactory를 apacheml httpclient를 사용하는 경우 지원되는 기능이다. 다음처럼 HttpClientBuilder에 redirectStrategy 설정을 하면 요청된 결과가 302인 경우 해당 페이지로 리다이렉트 된 결과를 반환해준다. RestTemplate restTemplate = new RestTemplate(); HttpComponen..