나는 나의의 context.xml에 다음과 같은 한 : 나는 정적 스프링 애플리케이션 컨텍스트를 통해 POJO이 빈을 검색하고가져 특성/값
<bean id="myBean" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:${specific.dir}/file1.properties</value>
<value>file:${specific.dir}/file2.properties</value>
<value>file:${specific.dir}/file3.properties</value>
<value>file:${specific.dir}/file4.properties</value>
</list>
</property>
</bean>
, 디버거를 통해가는이 않습니다. 날이 POJO의 목록에있는 네 개의 값 및 속성 이름을 검색하는
어쨌든이 있나요?
public class StaticSpringApplicationContext implements ApplicationContextAware {
private static ApplicationContext CONTEXT;
public void setApplicationContext(ApplicationContext context) throws BeansException {
CONTEXT = context;
}
public static Object getBean(String beanName) {
return CONTEXT.getBean(beanName);
}
}
을 내가 가지고 내 POJO이 다음 :
StaticSpringApplicationContext.getBean("myBean");
어떤 도움이나지도
이 크게 감사합니다 다음과 같이내 staticSpringApplicationContext이다. 제가 인정하는 것보다 봄에 더 많은 어려움을 겪었습니다.