关键是StartupListener.java
代码中有提示 如下
Keep in mind that this listener is executed outside of OpenSessionInViewFilter,
* so if you're using Hibernate you'll have to explicitly initialize all loaded data at the
* Dao or service level to avoid LazyInitializationException. Hibernate.initialize() works
* well for doing this.
下面的链接中提到三种方法
对于以Struts为Web框架的情况
阅读(710) | 评论(0) | 转发(0) |