본문 바로가기
반응형

springboot4

[Springboot] Message properties 사용 @Data public class Dto { @NotNull(message="name must not be null") private String name; .... } 위와 같은 방식으로 DTO에 message를 하드코딩해서 각 항목별로 validation을 수행할 수 있지만 관리적인 측면이나 다국어 적용시 이는 문제가 될 수 있다. 이를 해결하기 위해 Spring에서 message를 사용하듯이 code(key) 값을 넣어서 별도의 공간에 정의되어 있는 message를 가지고 오고자 한다. classpath:/messages/validation.properties name.notnull=name must not be null​ message.properties 파일에 넣어도 되지만 validation .. 2023. 8. 21.
[spring boot] context-path, 포트 설정 [spring boot] context-path, 포트 설정 프로젝트를 만들고 실행하게 되면 기본 설정인 http://localhost:8080/ 으로 접속하면 초기 화면이 나온다. context-path 추가 src/main/resources/application.properties server.servlet.context-path=/www 설정시 http://localhost:8080/www로 접속가능. server.port=80 설정시 http://localhost/www로 접속가능. 그 외 spring boot 에서 제공하는 많은 option들은 아래 링크에서 확인하면 된다. https://docs.spring.io/spring-boot/docs/current/reference/html/commo.. 2019. 9. 20.
[WARNING] The requested profile "pom.xml" could not be activated because it does not exist. [WARNING] The requested profile "pom.xml" could not be activated because it does not exist. project -> 오른쪽 마우스properties 선택pom.xml 삭제​ 2019. 9. 17.
[spring boot] context-path, 포트 설정 [spring boot] context-path, 포트 설정 프로젝트를 만들고 실행하게 되면 기본 설정인 http://localhost:8080/ 으로 접속하면 초기 화면이 나온다. context-path 추가 src/main/resources/application.properties server.servlet.context-path=/www 설정시 http://localhost:8080/www로 접속가능. server.port=80 설정시 http://localhost/www로 접속가능. 그 외 spring boot 에서 제공하는 많은 option들은 아래 링크에서 확인하면 된다. https://docs.spring.io/spring-boot/docs/current/reference/html/commo.. 2019. 5. 23.
반응형