Study/Java (183) 썸네일형 리스트형 Copilot4Eclipse 사용해 보기 Copilot4Eclipse 소개Github Copilot 은 IDE에서 코드 작성 시 AI를 이용해 코드 작성을 도와주는 생산성 도구이다.2024년 12월 18일부터 무료 플랜을 제공하기 시작했다.https://github.blog/news-insights/product-news/github-copilot-in-vscode-free/VS code에는 자동으로 통합되어 업데이트만 하면 바로 사용이 가능하지만 Eclipse 사용자의 경우 Copilot4Eclipse plugin( 무료 plugin)을 marketplace에서 검색하여 설치하면 Github Copilot을 Eclipse에서 바로 사용할 수 있다.Github Copilot을 써본 적이 없어서 불편함을 느끼지 못했던 터라 사용해 볼 생각을 안 .. Window 개발 환경에서 https로 Spring Boot Application 개발하기 Https 환경의 개발이 필요한 경우요즘은 대부분의 사이트가 Https 로 동작한다.개발 시 보통 별다른 설정 없이 http로 사용하지만 https로 개발을 하고 싶은 경우가 있다.https에서만 사용이 허용되는 기능들이 아래와 같이 다양하게 있다.Service WorkersGeolocation APIWeb Push NotificationsCredential Management APIPayment Request APIWeb Bluetooth APIWebRTCClipboard APISubresource IntegritySecure ContextCookie Secure Flag이런 것들을 개발하려고 하면 로컬 개발 환경도 https여야 한다.보통 localhost 같은 도메인은 별다른 설정을 하지 않아도 브.. Mybatis에서 custom MapTypeHandler 사용해 보기 mysql / mariadb를 사용하면서 db table에 JsonType column (LongText 유형에 json_valid 제약 조건이 걸려있는 column)을 사용하는 경우 해당 column은 json 형태로 데이터를 저장할 수 있다.json data는 java object에선 특정 도메인 또는 Map으로 지정하여 사용할 수 있고 Spring Data Jpa를 사용하는 경우 @JdbcTypeCode(SqlTypes.JSON) 을 해당 값에 지정하면 된다.Mybatis에서는 db table column의 json data를 java의 Map으로 변환해 주는 처리가 없어서 mysql 쿼리 사용 시 오류가 발생한다.https://mybatis.org/mybatis-3/configuration.htm.. ApplicationContextRunner에서 Condition Evaluation Report 확인하기 Spring Boot 기반 autoconfigure 환경을 제공하는 프로젝트 경우 테스트 코드 작성 시 Spring이 제공하는 ApplicationContextRunner , WebApplicationContextRunner , ReactiveWebApplicationContextRunner 를 사용하여 작성하게 된다.예전엔 ApplicationContextRunner 또는 WebApplicationContextRunner 사용 시 debug=true 옵션을 추가하면 boot 관련 로그를 확인할 수 있었다.버전이 올라가면서 로그를 확인하는 방식이 바뀌었고 기존 코드의 runner 실행 시 로그가 보이지 않게 되었다.아래처럼 initializer로 ConditionEvaluationReportLogging.. Spring Boot 3.4 Release Notes 전체 Release Notes 목록은 이곳에서 확인할 수 있습니다.https://luvstudy.tistory.com/tag/Release%20Noteshttps://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes17 revision 기준으로 작성됨Spring Boot 3.4 Release NotesUpgrading from Spring Boot 3.3RestClient and RestTemplateReactor Netty의 HttpClient 또는 JDK의 HttpClient 를 사용하도록 RestClient 및 RestTemplate 을 auto-configure 하는 지원이 추가되었습니다.우선순위에 따라 지원되는 c.. hibernate SqlType.JSON (json data) 사용해 보기 Java entitiy domain에서 특정 class나 map으로 db의 json 데이터를 바인딩하여 사용할 수 있다.Java domain class에 변경 사항이나 추가 사항을 계속 추가하면서 db에 조금씩 column을 수정/추가하는 것보다db의 json data 저장 column 하나에 가변적으로 값을 계속 추가하여java 쪽 entitiy class에선 json domain class의 최소한의 수정이나 map에서 변경되거나 추가된 값을 호출하여 사용하는 식으로 관리할 수 있다.Java Entity Domain Entity JSON type 선언https://bootify.io/spring-data/hibernate-json-type.htmlHibernate 6.0 이상에선 json type을 .. Spring Cloud Context의 @RefreshScope를 사용하여 properties 설정 갱신하기 기본적인 @ConfigurationProperties , @PropertySource 사용Spring Boot 기반 프로젝트에서 @ConfigurationProperties 로 지정된 bean은 처음 application이 startup 할 때 bean이 생성되고 여러 properties 파일에서 읽어와 Environment에 저장된 값을 가져와 해당 bean에 바인딩해 준다.다음과 같이 @ConfigurationProperties 를 선언하고@ConfigurationProperties(prefix = "someProperties")@Datapublic class SomeProperties { private String someKey1; private long someKey2; //.. .. springdoc swagger ui에 authorize 사용해 보기 swagger ui에서 api를 테스트하면서 인증을 사용하고 싶은 경우 어떻게 하면 될까?swagger는 이와 관련하여 securityScheme를 제공한다.@SecurityScheme annotation을 사용하거나 OpenAPI 설정의 securityScheme 항목을 설정하면 된다.springdoc 문서에는 OpenAPI 설정에 대한 예시가 있다.https://springdoc.org/#how-can-i-define-securityschemeSecuritySchema 설정하기 @Bean public OpenAPI customOpenAPI(@Value("${springdoc.version}") String appVersion) { return new OpenAPI() .components(new.. 이전 1 2 3 4 ··· 23 다음