是直接测试还是用在WEB里测试啊>
解决方案 »
- 系统日志问题
- 考勤机考勤数据如何用程序实时导出?
- jquery 插件 tablesort 对表格排序问题
- 请问:如何用YUI的connection创建一个同步而不是异步的request
- 朋友们 帮帮忙
- ldap到底是做什么用?
- 程序员如何成长?欢迎大家讨论!给点建议
- Struts 中的弹出页面问题
- 誰有jsp 访问sql server 的各种例程?使用microsoft driver for jdbc
- struts的类库怎么找不到呢?
- struts2 中<jsp:forward>转向的问题。。请高手解答!!!
- 记得以前看到有个工具可以输出hibernate 中的sql语句的中的变量值,不过忘记叫什么名字了,有哪位知道?
在你的web.xml文件中有没有配置SPRING
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param> <filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
试试
<constructor-arg>
<ref local="sessionFactory" />
</constructor-arg>
</bean>
去掉!
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
而不是sessionFactory注入 UserDaoImpl。