OpenSessionInViewFilter配置说明

配置在web.xml中

xml 代码
  1. <!--OpenSessionInViewFilter配置,其实是一个又繁琐性能又低的东西,以后再也不想用到-->  
  2.         <filter>  
  3.                 <filter-name>OpenSessionInViewFilter</filter-name>  
  4.                 <filter-class>  
  5.                         org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
  6.                 </filter-class>  
  7.                 <!-- singleSession默认为true,若设为false则等于没用OpenSessionInView -->  
  8.                 <init-param>  
  9.                         <param-name>singleSession</param-name>  
  10.                         <param-value>true</param-value>  
  11.                 </init-param>  
  12.         </filter>  
  13.         <filter-mapping>  
  14.                 <filter-name>OpenSessionInViewFilter</filter-name>  
  15.                 <url-pattern>*.do</url-pattern>  
  16.         </filter-mapping>  
  17.   
  18.         <!--Spring Context listener-->  
  19.         <listener>  
  20.                 <listener-class>  
  21.                         org.springframework.web.context.ContextLoaderListener   
  22.                 </listener-class>  
  23.         </listener>  
  24.   
  25.  <!--让spring知道事务管理的bean所在-->  
  26.      <context-param>    
  27.         <param-name>contextConfigLocation</param-name>    
  28.         <param-value>/WEB-INF/applicationContext*.xml</param-value>    
  29.     </context-param>   
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值