是直接测试还是用在WEB里测试啊>
解决方案 »
- java文件操作
- struts1提交请求时的问题(与路径有关)
- Struts2的校验文件在SHH2框架中不起作用?
- 期待高人指点~tomcat启动怎么这么慢~!!
- java中怎么在不打开word文档的情况下打印里的内容 着急啊~~谢谢
- java连接Mysql错误
- 我自己定义的异常 在action中 不拦截异常 最终都抛到一个jsp页面中 可以不
- 我把jbuilder和weblogic连起来了,作了一个最简单的servlet。部署也成功了(起码没包错)不过我访问时 http://localhost:7001/firstWebAp
- hibernate两表关联,记录要求排序的问题
- 我是初学者,怎么开始???
- 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。