`
xiaofengxbf
  • 浏览: 18403 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

OpenSessionInViewFilter 的配置情况(web.xml)

 
阅读更多

web.xml 整个配置,用于整合ssh框架

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name></display-name>   
 
  <!-- spring配置文件位置 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext-c3p0.xml</param-value>
    </context-param>
   
    <!-- openSessionInView配置 -->
    <filter>
        <filter-name>openSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
        <init-param>
            <param-name>singleSession</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
              <param-name>flushMode</param-name>
              <param-value>AUTO</param-value> 
        </init-param>
    </filter>
   
    <!-- Struts2配置 -->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>openSessionInViewFilter</filter-name>   <!-- 要留意此处的顺序,一定是要在strust2之前进行配置 -->
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
   
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
   
    <!-- spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
 
</web-app>

分享到:
评论

相关推荐

    关于OpenSessionInViewFilter的学习

    NULL 博文链接:https://yanzhenwei.iteye.com/blog/1701164

    OA项目SSH整合框架

    &lt;set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor" /&gt; 3,测试 1,写Action类与Service类 @Controller("testAction") @Scope("prototype...

    OpenSessionInViewFilter

    OpenSessionInViewFilter个人学习总结

    spring_demo:Spring MVC示范项目

    Spring MVC Hibernate Demo ...且在web.xml中添加 &lt;filter&gt;openSessionInViewFilter &lt;filter&gt;org.springframework.orm.hibernate4.support.OpenSessionInViewFilter &lt;param&gt;flushMode&lt;/param-nam

    Struts2+Spring+hibernate中对action的单元测试环境搭建[总结].pdf

    解决这个问题的方法有两种:一种是在 web.xml 中使用 Spring 提供的 OpenSessionInViewFilter,另一种是在 application.xml 中配置 OpenSessionInViewFilter。前者通用,后者只能用于 SpringMVC 结构中。 最后,...

    Sping 事务管理.doc

    OpenSessionInViewFilter解决Web应用程序的问题

    Mac Mysql数据库中文乱码问题解决

    如:在使用Java中得SSH框架时,我们需要在web.xml文件中配置编码的filter,具体代码是: &lt;span xss=removed&gt;&lt;!-- 表单处理乱码,必须在OpenSessionInViewFilter的filter之前 --&gt; &lt;filter&gt;CharacterFilter ...

    spring_note.rar_inversion_spring concept

    课程内容 面向接口(抽象)编程的概念与好处 IOC/DI的概念与好处 inversion of control dependency injection AOP的概念与好处 ...opensessionInviewfilter(记住,解决什么问题,怎么解决) Spring JDBC

    SSH项目整合示例【OpenSessionInView】所用到的jar包

    SSH项目整合示例【OpenSessionInView】所用到的jar包 包含Struts + Hibernate + Spring所有jar及其依赖的jar

    SPRING API 2.0.CHM

    OpenSessionInViewFilter OpenSessionInViewInterceptor OpenSessionInViewInterceptor OptimisticLockingFailureException OptionsTag OptionTag OptionWriter OracleLobHandler OracleLobHandler....

    jar包(struts2.0.8+spring2.0+hibernate3.2)

    struts2.0.8+spring2.0+hibernate3.2 jar包

    S2SH集成 案例

    该案例实现了一个简单的登录功能,但里面将S2SH集成的所有配置信息都添加进去了。 如,OpenSessionInViewFilter、声明式事务、三层等等

    struts+spring+hibernate整合

    Spring4.0、Struts2.3.15、Hibernate4.2.4、jQuery1.9.1涉及到了诸多开发时的细节:ModelDriven、Preparable 拦截器、编写自定义的类型转换器、Struts2 处理 Ajax、OpenSessionInViewFilter、迫切左外连接、Spring ...

Global site tag (gtag.js) - Google Analytics