Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring ResourceBundleMessageSource在Spring xml文件中配置多个属性文件?_Spring - Fatal编程技术网

Spring ResourceBundleMessageSource在Spring xml文件中配置多个属性文件?

Spring ResourceBundleMessageSource在Spring xml文件中配置多个属性文件?,spring,Spring,例如,我有两个属性文件,比如消息和查询。如何在SpringXML中配置好,您可以使用下面的代码片段 <context:property-placeholder location="classpath:dao.properties, classpath:services.properties, classpath:user.properties" ignore-unresolvable="true"/> 在这种情况下,需要指定order属性

例如,我有两个属性文件,比如消息和查询。如何在SpringXML中配置好,您可以使用下面的代码片段

    <context:property-placeholder
    location="classpath:dao.properties,
    classpath:services.properties,
    classpath:user.properties"
    ignore-unresolvable="true"/>

  • 在这种情况下,需要指定order属性来修复Spring处理这些数据的顺序
  • 除最后一个(最高顺序)之外的所有属性占位符都应具有
    ignore unsolvable=“true”
    ,以允许解析机制传递给上下文中的其他占位符,而不会引发异常

  • 为什么不使用@Bean定义?下面是错误消息。无法将[org.springframework.beans.factory.config.PropertyPlaceHolderConfigure]类型的值转换为属性“basename”所需的[java.lang.String]类型:在org.springframework.beans.TypeConverterDelegate.ConvertifEssential(TypeConverterDelegate.java:289)中找不到匹配的编辑器或转换策略在org.springframework.beans.TypeConverterDelegate.ConvertifEssential(TypeConverterDelegate.java:154)在org.springframework.beans.BeanRapperImpl.convertForProperty(BeanRapperImpl.java:452)上。。。30多个你能在这里分享完整的堆栈跟踪吗?可能bean属性与属性类型不匹配。