xyz.properties文件中定义了abc值
另外的xml文件如何用${abc} 这种形式取到值
已将xyz.properties放到classpath
缺什么包?

解决方案 »

  1.   

    以前用struts2了,有ognl一说,因此能取到值这回没用,怎么就娶不到了呢
      

  2.   

    spring 的包
    <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>/WEB-INF/classes/theApp.properties</value>
    </list>
    </property>
    </bean>
      

  3.   

    缺spring的包,用在spring的配置文件里
    applicationContext.xml<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
     <value>classpath:xyz.properties</value>
        </property>
    </bean>
      

  4.   

    一般spring配置数据源的时候用到这个但是为了这样一个小功能特意加上spring包好像没什么必要哦最好是自己写个,难度应该不大