`
huiqinbo
  • 浏览: 335083 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

hibernateFilter作用(在web.xml中配置)

阅读更多

 

1.
<filter>
    <filter-name>Spring character encoding filter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>GBK</param-value>
</init-param>
这个是用来处理乱码问题的

更多了解,更多交流(QQ:444084929 软件框架师 :回钦波)

 

2.
<context-param>
<description>spring init </description>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/bean.xml</param-value>
</context-param>
这个配置是用来指定spring配置文件所在的位置的

3.

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
这个是用来对spring容器进行初始化,做为监听器的

 

 

4.

<filter>

    <filter-name>hibernateFilter</filter-name>

        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>

</filter>

 

这是Spring封装hibernate后提供的一个过滤器,这个过滤器的作用是:每一次请求来的时候都打开一个session每次请求结束后关闭session,解析hibernat延迟加载产生的异常。

  • 大小: 80 KB
  • 大小: 58.5 KB
3
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics