본문 바로가기

개발 관련 기록과 정리/복사 글

(3)
Spring Boot Validation Message 바꾸기 유효성 검사에서 메세지를 강제적으로 바꿀수 있다. https://stackoverflow.com/questions/6048556/can-you-change-an-annotation-message-at-run-time Can you change an annotation message at run time? I'm trying to include a dynamic message in my annotation that changes the main body of the text based on the values that are found in the other variables that are passed to it. I set a default mes... stackoverflow.com
Maven multi module에서 yml(yaml) 오버라이딩 설정 (spring boot 2.x) @PropertySources({ @PropertySource("application-share.yml"), @PropertySource("application.yml") }) @PropertySource(value = { "classpath:/application.yml", "classpath:/application-share.yml" }) 위 방식은 확장자가 properties의 경우, 사용 가능하다. yml(yaml)은 사용 불가능하다. 방법1. 메인이 되는 yml과 서브 yml를 가질 경우의 설정(서브 yml이 2개 이상이면 문제 발생하므로 비추천) 질문 : I have a Spring boot application that is divided in several modules. The main ..
Spring에서 @Valid와 @Validated의 차이점 Spring에서 @Valid와 @Validated의 차이점 Spring은 두 가지 유효성 검사 메소드 인 Spring 유효성 검사와 JSR-303 bean 유효성 검사를 지원합니다. 둘 모두는 bean validator를 포함한 다른 위임자에게 위임하는 Spring 유효성 검사기를 정의함으로써 사용될 수 있습니다. 여태까지는 그런대로 잘됐다. 그러나 실제로 유효성 검사를 요청하는 메소드에 주석을 달 때, 그것은 또 다른 이야기입니다. 나는 이렇게 주석을 달 수있다. @RequestMapping(value = "/object", method = RequestMethod.POST) public @ResponseBody TestObject create(@Valid @RequestBody TestObject o..