开发者

Map of Maps Initialization in Application Context

I want to initialize a Map of Maps in the Spring context file. I'm getting this xsd error.

cvc-complex-type.2.4.d: Invalid content was found starting with element 'map'. No child element is expected at this point.

This is the bean defnition:

<bean id="voToDOMapper" class="com.yyy.yyy.yyy.yyy.configuration.VOToDOMapper" factory-method="getInstance">
    <property name="channelToMapper">
    <map key-type="java.lang.String" value-type="java.util.HashMap">
        <entry key="yyy" >
        <value>
            <map>
                <entry key="com.yyy.yyy.yyy.AsyncAdd开发者_C百科ressChangeEventVO">
                    <value>com.yyy.yyy.yyy.vo.yyy.FakeAcctAddressEvent</value>
                </entry>
            </map>
        </value>
        </entry>
    </map>
    </property>

</bean> 

Any help will be appreciated.


One way

<util:map>
        <entry key="x" value-ref="val1"></entry>
</util:map>

<util:map id="val1">
    <entry key="a" value="blob"></entry>
    <entry key="b" value="clob"></entry>
</util:map>

enable xmlns:util="http://www.springframework.org/schema/util


Example of using of util: http://www.java2s.com/Code/Java/Spring/CreateListMapInContext.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜