Spring OpenSessionInViewInterceptor不起作用

Spring OpenSessionInViewInterceptor不起作用,第1张

Spring OpenSessionInViewInterceptor不起作用

您在使用@RequestMapping注释吗?如果我没记错的话,将拦截器放在url bean上存在问题。在Spring 3.0中,您可以这样定义拦截器:

<mvc:interceptors>    <bean >        <property name="sessionFactory"> <ref local="sessionFactory" />        </property>    </bean></mvc:interceptors>

假设sessionFactory是对SessionFactory bean的引用。

您还需要包括mvc命名空间。

xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5442559.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存