zoukankan      html  css  js  c++  java
  • SSH中的Dao类继承HibernateDaoSupport后出现异常

    异常:'sessionFactory' or 'hibernateTemplate' is required

    原因:未注入hibernateTemplate,需要在spring的配置文件中明确指定bean以byName的方式匹配

    <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:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    "
    default-autowire="byName" >

  • 相关阅读:
    代码互改
    第一次个人编程作业
    第一次博客
    个人总结
    第三次个人作业--用例图设计
    第二次结对作业
    第一次结对作业
    记录浏览他人代码
    中文编程作业
    第一篇随笔
  • 原文地址:https://www.cnblogs.com/lmq-1048498039/p/6949581.html
Copyright © 2011-2022 走看看