在Spring框架中bean配置文件中constructor-arg标签中没有name元素?

bean配置文件出现错误的依赖:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                              http://www.springframework.org/schema/beans/spring-beans.xsd">

 

 

将以上依赖改成:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

 

就可在:bean标签下的constructor-arg标签中添加name属性了。

你可能感兴趣的:(开发出现错误解决方案)