cfq630 2014-07-01 10:36 采纳率: 0%
浏览 10290

Spring MVC配置问题,求解

我在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吗?

求解!!!!

  • 写回答

1条回答 默认 最新

  • yzdytm 2014-12-10 08:01
    关注

    新版本你需要用"bean="代替"local="

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler