夜雨竹林
落叶无声

一、  <!--使用spring解决struts1.3乱码问题  -->
  <filter>
   <filter-name>encoding</filter-name>
   <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
   <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
   </init-param>
  </filter>
  <filter-mapping>
   <filter-name>encoding</filter-name>
   <url-pattern>/*</url-pattern>
  </filter-mapping>

二、<!-- 使用spring解决hibernate因session关闭导致的延迟加载例外问题 -->
  <filter>
      <filter-name>OpenSessionInViewFilter</filter-name>
      <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
  </filter>
  <filter-mapping>
      <filter-name>OpenSessionInViewFilter</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>

posted on 2009-11-12 10:55  夜雨竹林  阅读(207)  评论(0编辑  收藏  举报