• Struts2升级版本到2.5.30


    pom 文件

        <!-- 加入struts2依赖包 -->
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-core</artifactId>
                <version>2.5.30</version>
                <exclusions>
                    <!-- 由于hibernate里面已经包含了javassist包,跟struts2的javassist冲突,所以struts2要排除这个引用 -->
                    <exclusion>
                        <groupId>javassist</groupId>
                        <artifactId>javassist</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
    
            <!-- struts2整合spring插件 -->
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-spring-plugin</artifactId>
                <version>2.5.30</version>
            </dependency>
            <!-- struts2注解插件 -->
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-convention-plugin</artifactId>
                <version>2.5.30</version>
            </dependency>
            <!-- 可以看到struts2应用里的Action等各种资源的影射情况 -->
            <!-- 可以使用类似http://localhost:9999/sshe/config-browser/showConstants.sy的url来访问 -->
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-config-browser-plugin</artifactId>
                <version>2.5.30</version>
            </dependency>
    

        <!-- 加入CXF依赖包 --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.7.7</version> <exclusions> <exclusion> <groupId>asm</groupId> <artifactId>asm</artifactId> </exclusion> </exclusions> </dependency>

    <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>3.2.5</version> </dependency>

    web.xml

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
      </filter>

    struts.xml

    <!-- 让struts2支持动态方法调用 (漏洞需要关闭动态调用方法)-->
        <constant name="struts.enable.DynamicMethodInvocation" value="true" />
    
    
    package 中加入<global-allowed-methods>regex:.*</global-allowed-methods>  注意位置
  • 相关阅读:
    html自定义加载动画
    数据结构与算法:贪心算法简介
    WEB 前端常用字体和色值你知道多少?
    为什么浮点精度运算会有问题
    Java 字符串格式示例
    使用 Java 和 Maven (JBake) 生成静态网站
    硅谷钢铁侠
    Flink中的5种窗口使用场景
    prometheus-operator监控k8s资源
    fluentd收集k8s集群pod日志
  • 原文地址:https://www.cnblogs.com/yscec/p/16285566.html
Copyright © 2020-2023  润新知