报错:Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameter
解决方法:
public class UrlConstant {
public static String AGENT_URL;
public static String STATISTICAL_URL;
public UrlConstant(String AGENT_URL, String STATISTICAL_URL){
super();
this.AGENT_URL = AGENT_URL;
this.STATISTICAL_URL = STATISTICAL_URL;
}
}
xml:
<bean id="urlConstant" class="gt.common.UrlConstant">
<constructor-arg index="0">
<value>http://www.baidu1.com</value>
</constructor-arg>
<constructor-arg index="1">
<value>http://www.baidu2.com</value>
</constructor-arg>
这样,UrlConstant 中就可以读到xml中配置的值了