你都继承HibernateDaoSupport 了,直接注入sessionFactory就行了,不用再写
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean> 

解决方案 »

  1.   

    <property name="hibernateTemplate">
              <ref local="hibernateTemplate"/>
    </property> 
    这个也不需要了,都去掉了,试试
      

  2.   

    另外提一下,既然你用了spring2.5了,那么为什么不用anotation,返回还要在xml里面配置LogintableDao
      

  3.   

    <bean id="LogintableDao" class="test.LogintableDao"> 
        <property name="hibernateTemplate"> 
            <ref local="hibernateTemplate"/> 
        </property> 
    </bean>
      

  4.   

    <?xml version="1.0" encoding="UTF-8"?>
    <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-2.5.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/htwebsite</value> </property> <property name="username"> <value>root</value> </property> <property name="password"> <value>root</value> </property> </bean>
    <!-- hibernate3 session Bean--> <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"><!-- 注入数据源 --> <ref local="dataSource" /> </property>
      <property name="mappingResources">
            <list>
                <value>test/Logintable.hbm.xml</value>
            </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean>
    <!-- 事务管理 -->
            
            <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory">
    <ref local="sessionFactory" />
            </property>
       </bean>
    <bean id="LogintableDao" class="test.LogintableDao">
    <property name="sessionFactory">
    <ref local="sessionFactory"/>
    </property> 
    </bean>
    <bean name="adduser" class="action.AddUserAction"></bean> 
    </beans>
      

  5.   

    你这个applicationContext.xml放在什么目录下了
    <listener-class>org.springframework.web.context.ContextLoaderListener </listener-class>
    </listener>
    似乎默认的是WEB-INF目录
    还有
    <!-- 事务管理 -->
           
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref local="sessionFactory" />
        </property>
    </bean>
    这个你也没挂事务啊,可以看看spring的中文文档找找spring配置文件怎么写吧
    还有后台有没有什么错误提示什么的