0

<bean id="parentTriangle" class="org.kiran.spring.Triangle" abstract="true">
<property name="type">
<list>
    <value>equilateral</value>
    <value>scalene</value>
</list>
</property>
</bean>

<bean id="triangle" class="org.kiran.spring.Triangle" parent="parentTriangle" >
<property name="type">
    <list merge="true">
        <value>isosceles</value>
    </list>
</property>
</bean>

它抛出一个错误我需要在标题中添加任何内容以使其工作吗?

4

1 回答 1

1

您的弹簧配置很好,您缺少方案配置。验证您的 spring 配置是否具有以下标头:

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

于 2012-08-13T15:07:13.207 回答