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>  注意位置

 

posted on 2022-05-18 17:26  西门夜说  阅读(836)  评论(0编辑  收藏  举报