OpenSessionViewFilter失效问题
2009-05-10 19:35
274 查看
struts和spring结合需要在struts-config.xml里面配置plugin:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath:spring/*.xml"/>
</plug-in>
web.xml加入:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
配置OpenSessionViewFilter:
<filter>
<filter-name>opensession</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>opensession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
测试结果:如果在struts-config.xml中加入plugin,则OpenSessionViewFilter失效。
去掉plugin后,问题解决。
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath:spring/*.xml"/>
</plug-in>
web.xml加入:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
配置OpenSessionViewFilter:
<filter>
<filter-name>opensession</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>opensession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
测试结果:如果在struts-config.xml中加入plugin,则OpenSessionViewFilter失效。
去掉plugin后,问题解决。
相关文章推荐
- OpenSessionInViewFilter失效问题
- OpenSessionInViewFilter失效问题
- Spring与Hibernate整合中,使用OpenSessionInViewFilter后出现sessionFactory未注入问题
- OpenSessionInViewFilter解决Hibernate延时加载问题
- 异常处理:SSH整合中OpenSessionInViewFilter不生效问题的解决
- spring data jpa懒加载session失效:OpenEntityManagerInViewFilter 取代OpenSessionInViewFilter
- Spring与Hibernate整合中,使用OpenSessionInViewFilter后出现sessionFactory未注入问题
- OpenSessionInViewFilter问题
- 37-002-1 通过spring的OpenSessionInViewFilter解决jsp页面懒加载显示的问题
- 使用OpenSessionInViewFilter解决session关闭问题
- OpenSessionInViewFilter不起作用问题
- Spring使用OpenSessionInViewFilter解决Hibernate的lazy延时加载问题
- Spring使用OpenSessionInViewFilter解决Hibernate的lazy延时加载问题
- Spring使用OpenSessionInViewFilter解决Hibernate的lazy延时加载问题
- 延时加载问题解决OpenSessionInViewInterceptor 和 OpenSessionInViewFilter的配置
- OpenSessionInViewFilter更新问题
- Spring使用OpenSessionInViewFilter解决Hibernate的lazy延时加载问题
- Spring使用OpenSessionInViewFilter解决Hibernate的lazy延时加载问题
- OpenSessionInViewFilter的时候遇到的问题
- OpenSessionInViewFilter的一些问题