일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- java
- Exception
- 자바
- transaction
- QueryDSL
- 스프링 핵심 원리
- Spring Boot
- springdatajpa
- AOP
- 스프링 핵심 기능
- spring
- 백준
- pointcut
- http
- 알고리즘
- Proxy
- SpringBoot
- 그리디
- 인프런
- Thymeleaf
- JDBC
- db
- 김영한
- Servlet
- JPQL
- 스프링
- kotlin
- Android
- Greedy
- jpa
- Today
- Total
목록messages.properties (2)
개발자되기 프로젝트
1. MessageSource Interface public interface MessageSource { String getMessage(String code, @Nullable Object[] args, @Nullable String defaultMessage, Locale locale); String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException; } code와 일부 파라미터로 메세지를 읽어올 수 있는 기능을 제공 2. 예시-기본 앞서 messages.properties에 아래와 같이 등록했다. 여기서 hello는 code, 안녕은 message 이다. hello=안녕 hello..
1. Spring Message Source 설정 메시지 관리 기능을 사용하려면 스프링이 제공하는 MessageSource 를 스프링 빈으로 등록이 필요하다. MessageSource 는 인터페이스이다. 따라서 구현체인 ResourceBundleMessageSource 를 스프링 빈으로 등록하면 된다. 2. 직접 등록 @Bean public MessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); messageSource.setBasenames("messages", "errors"); messageSource.setDefaultEncoding("utf-8"); re..