Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.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中调用特定属性文件_Spring_File_Properties - Fatal编程技术网

如何在spring中调用特定属性文件

如何在spring中调用特定属性文件,spring,file,properties,Spring,File,Properties,我有3个属性文件,即propA、propB和propC定义的application-context.xml 我需要调用特定的道具文件。比如说,对于A类我需要呼叫propA,对于B类我需要呼叫propB,对于C类我需要呼叫propC 但这并没有发生。它一直在为所有类加载propA 我曾经 @PropertySource("classpath:propA.properties") public class A { @Override @LoginLogout(skip=true) public vo

我有3个属性文件,即propA、propB和propC定义的application-context.xml

我需要调用特定的道具文件。比如说,对于A类我需要呼叫propA,对于B类我需要呼叫propB,对于C类我需要呼叫propC

但这并没有发生。它一直在为所有类加载propA

我曾经

@PropertySource("classpath:propA.properties")
public class A {
@Override
@LoginLogout(skip=true)
public void execute(Webdriver driver)  {
    execute (driver);
}
}在B类中使用:

@PropertySource("classpath:propB.properties")
C类用途:

@PropertySource("classpath:propC.properties")

我做了同样的事情,但它总是加载所有类的最后一个道具值…当有多个道具文件具有相同的键但不同的值时该怎么办。并在各自的类中加载@PropertySourceclasspath:propA.properties类A{fdsf;}@PropertySourceclasspath:propB.properties类B{fdsf;}但与applicationcontext.xml类路径一样:propA.properties类路径:propB.properties,但问题是它总是重载propB值。如何应对?