我在xml里配置
<
bean
id="jdbcTemplate" p:dataSource-ref="dataSource" class="org.springframework.jdbc.core.JdbcTemplate"
/>
<bean id="userDaoJdbc" class="com.maya.web.dao.impl.UserDaoImpl">
<property name="jdbcTemplateTarget">
<ref local="jdbcTemplate"/>
</property>
</bean>
如此的话tomcat启动会报错:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 49 in XML document from URL [file:/E:/apache-tomcat-6.0.36/webapps/maya/WEB-INF/classes/conf/spring-jdbc-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'local' is not allowed to appear in element 'ref'.
改成(local改成bean就可以了。):
不是在一个xml里可以用local吗?
求解!!!!
新版本你需要用"bean="代替"local="