我一直在尝试以下:
<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"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
................
>
<bean id="dateBean" class="org.apache.velocity.tools.generic.NumberTool"/>
<bean id="service" class="package.xyz">
<property name="toolMap">
<util:map map-class="java.util.HashMap">
<entry key="number"><ref:bean="dateBean"/></entry>
</util:map>
</property>
</bean>
如您所见,这是针对速度工具配置的。
我得到这个例外:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'util:map'.
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'util:map'.
谁能帮我解决这个问题?
更新:我添加了 XML 声明。