zoukankan      html  css  js  c++  java
  • 配置Spring的用于解决懒加载问题的过滤器

    <?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">

        <!-- 配置Spring的用于初始化容器对象的监听器 -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext*.xml</param-value>
        </context-param>
        
        <!-- 配置Spring的用于解决懒加载问题的过滤器 -->
        <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>*.action</url-pattern>
        </filter-mapping>

    <!-- 一定要配置在struts2的过滤器之前-->
        
        <!-- 配置struts2的核心过滤器 -->
        <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

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

  • 相关阅读:
    超级好用的装机神器——Ventoy
    CentOS7.4安装Nvidia Tesla T4驱动
    ESXI常用命令
    阿里云|腾讯云MySQL备份文件一键恢复工具
    在甲方做三年安全的碎碎念
    golang操作docker
    Nginx Module扩展模块实现
    炒冷饭之ThinkPHP3.2.X RCE漏洞分析
    Windows:sysprep.exe工具:审核模式 VS OOBE模式(工厂模式 VS 用户模式)
    高校毕业生人数增长图
  • 原文地址:https://www.cnblogs.com/siashan/p/3959109.html
Copyright © 2011-2022 走看看