TestMain이 아닌 일반클래스(빈, UserService)에서 사용하는 방법
·
Framework/SPRING FRAMEWORK
UserService implements MessageSourceAware @Override (추상메서드) public void setMessageSource(MessageSource xxx){ String mesg = xxx.getMessage(”greeting”, ~~~); } 재정의하면 자동으로 setMessageSource메서드의 파라미터로 MessageSource(ApplicationContext)가 자동으로 주입된다. 💡 You can also use the MessageSourceAware interface to acquire a reference to any MessageSource that has been defined. Any bean that is defined in an Applic..
I18N - 국제화(지역화)
·
Framework/SPRING FRAMEWORK
InternationalizatioN https://docs.spring.io/spring-framework/docs/5.2.25.RELEASE/spring-framework-reference/core.html#context-functionality-messagesource Core Technologies In the preceding scenario, using @Autowired works well and provides the desired modularity, but determining exactly where the autowired bean definitions are declared is still somewhat ambiguous. For example, as a developer loo..
스프링에서 jdbc.properties 내용 불러오기
·
Framework/SPRING FRAMEWORK
Mybatis 할 때 jdbc.properties에 4가지 정보 설정하고 Configuration.xml에 불러와서 사용했음 1️⃣ com.config 폴더 아래에 jdbc.properties 파일 작성 2️⃣ user.xml 등록 1) PropertyPlaceholderConfigurer 2) context namespace ⭐⭐⭐ //context추가 필요 xmlns:context="http://www.springframework.org/schema/context" //스키마Loaction 추가 필요 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/sprin..
profile
·
Framework/SPRING FRAMEWORK
개발시 환경을 다르게 구축한다. ( developement 환경 / production 환경 ) 💻 dev 결과 💻 prod 결과
현재 실행중인 운영체제의 환경변수 값 살펴보기
·
Framework/SPRING FRAMEWORK
1️⃣ 일반 자바 클래스 이용 Properties props = System.getProperties(); Set keys = props.stringPropertyNames(); for (String key : keys) { System.out.println(key + "\\t" + props.getProperty(key)); } System.out.println("#################################################"); 2️⃣ 스프링 이용 GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); ConfigurableEnvironment env = ctx.getEnvironment(); Map m..
xoo | 수진
xoo의 성장기록