내 web.xml 파일의 일부입니다web.xml에서 contextConfigLocation 매개 변수와 함께 .properties 파일을 사용할 수 있습니까? 여기
<context:property-placeholder location="classpath:properties/db.properties"/>
는 특성이 오히려 web.xml 파일에서 사용하는 파일을 정의 할 어떻게 든 가능 :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:application-config.xml
</param-value>
</context-param>
응용 프로그램-config.xml의 속성 자리 표시자를 사용 application-config.xml보다? 스프링 3.0의 EL
<bean id = "myLocation" class =
"org.springframework.web.context.support.ServletContextParameterFactoryBean">
<property name="initParamName" value = "myParameter" />
</bean>
<bean class =
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" ref = "myLocation" />
</bean>
또는 사용 :
web.xml에서 db.properties를 어떻게 가져 왔습니까? 나는 $ {property.name}을 시도했다. 그러나 그것은 작동하지 않습니다. – Ani