파란하늘의 지식창고
article thumbnail
STS 4.19.0 Release 소식 및 Windows 11에서 Windows Defender 예외 처리 하기
Study/Java 2023. 6. 16. 21:08

STS 4.19.0 Release STS가 4.17.0 Release 이후 language server 무한 로딩 현상이 발생하였었다. 2023.01.05 - [Study/Java] - [오류수정반영예정] STS 4.17.x, 4.18.x 무한 로딩 현상 https://luvstudy.tistory.com/217 관련해서 몇 차례 수정이 진행되었었지만 지속적으로 발생하였다. 내 경우 최신 버전의 Spring을 사용한 프로젝트에서는 해당 문제가 발생하지 않았지만 이전 버전 Spring을 사용하는 프로젝트에서 무한 로딩 현상이 계속 발생하였고 이로 인해 어쩔 수 없이 4.17.0 이전 버전 STS를 사용하였다. 2022년 12월 7일 4.17.0이 나온 이후 6개월의 기간 동안 STS 버전 업그레이드를 하지..

Spring JDBC AbstractRoutingDataSource, DelegatingDataSource 사용해 보기
Study/Java 2023. 6. 15. 01:52

spring-jdbc 소개 spring-jdbc 는 jdbc 관련 기능을 제공하는 라이브러리이다. DB를 연결하여 사용하기 위해 해야 하는 작업 중 상당 부분을 스프링이 처리해 준다. https://docs.spring.io/spring-framework/reference/data-access/jdbc.html Action Spring You Define connection parameters. X Open the connection. X Specify the SQL statement. X Declare parameters and provide parameter values X Prepare and run the statement. X Set up the loop to iterate through the..

Spring Boot 프로젝트 properties 암복호화 처리 구현하기
Study/Java 2023. 6. 11. 03:32

Spring Boot 프로젝트에서 암복호화 사용에 대해 https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.encrypting Spring Boot를 사용할 경우 properties의 값의 암호화를 위한 기본 지원을 제공하지 않는다. 다만 Spring Environment에 포함된 값을 수정하는데 필요한 hook point를 제공한다. EnvironmentPostPropcessor interface를 구현하여 application이 start 하기 전에 environment를 조작할 수 있다. 따라서 EnvironmentPostProcessor를 통해 properties의 값..

Spring Boot 3.1 Release Notes
Study/Java 2023. 5. 26. 22:17

전체 Release Notes 목록은 이곳에서 확인할 수 있습니다. https://luvstudy.tistory.com/tag/Release%20Notes https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.1-Release-Notes 19 revision 기준으로 작성됨 Upgrading from Spring Boot 3.0 Dependency Management for Apache HttpClient 4 Spring Framework 6에서는 Apache HttpClient 5를 선호하기 위해 RestTemplate 을 사용하는 Apache HttpClient 4에 대한 지원이 제거되었습니다. Spring Boot 3.0에는 HttpC..

JDK 20 New Features
Study/Java 2023. 5. 7. 15:39

JDK의 버전별 변경 사항은 이곳을 참고하세요. Spec Java SE 20 Platform JSR 395에 정의된 바와 같이 JSR 395 구현이 목표 실제 Spec은 Final Release Specification 문서를 참고해야 함 Final Release Specification Feature Summary 전체 JEP Feature 목록은 OpenJDK의 JDK20 문서로 확인할 수 있다. JEP Component Feature JEP 429 core-libs Scoped Values (Incubator) JEP 432 specification/language Record Patterns (Second Preview) JEP 433 specification/language Pattern Mat..

article thumbnail
spring-asciidoctor-backends 사용해 보기
Study/Java 2023. 5. 6. 11:54

spring-asciidoctor-backends 소개 spring으로 개발하면 spring documentation을 자주 보게 된다. https://docs.spring.io/spring-framework/docs/current/reference/html/ 이 문서는 asciidoctor를 사용하여 만들어졌다. java maven에서는 asciidoctor-maven-plugin을 사용하여 문서를 생성한다. https://asciidoctor.org/ spring-asciidoctor-backends는 asciidoctor-maven-plugin dependency에 추가하는 라이브러리로 spring documentation 생성 시 필요한 몇 가지 기능과 문서 스타일을 제공한다. 이전에 spring..

RestTemplate response generic type 사용하기
Study/Java 2023. 5. 5. 02:17

ParameterizedTypeReference를 사용한 List response 사용 예전에 restTemplate으로 list 타입 response를 받는 것에 대해 글을 작성한 적이 있다. 2018.11.16 - [Study/Java] - RestTemplate list 반환하기 응답이 List 일 때 ParameterizedTypeReference로 아래와 같이 사용한다. ResponseEntity response = restTemplate.exchange("url",HttpMethod.GET, null, new ParameterizedTypeReference() {}); List list = response.getBody(); Generic response type 사용하기 이 경우에 대해서도 ..

ObjectMapper readValue generic type 사용하기
Study/Java 2023. 4. 23. 08:39

List 객체를 반환받기 위해 TypeReference 사용하기 ObjectMapper는 List 같은 Collection 형태의 객체 반환을 위해 TypeReference를 제공하고 있다. (정확히는 List를 위해서가 아니라 generic parameterType을 가진 class를 위해서 제공하고 있다.) 이를 사용하면 다음과 같이 List를 받을 수 있다. List objectMapper.readValue(new ClassPathResource("someFile.json").getFile(), new TypeReference