zoukankan      html  css  js  c++  java
  • struts2配置成功

    结构图如下:

    pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.apache.struts</groupId>
                    <artifactId>struts2-core</artifactId>
                    <version>2.3.4.1</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-core</artifactId>
                    <version>3.1.2</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-web</artifactId>
                    <version>3.1.2</version>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
    </project>

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    
        <display-name>testS2</display-name>
    
        <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.html</welcome-file>
        </welcome-file-list>
    
    </web-app>

    struts.xml

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
        <constant name="struts.devMode" value="true" />
        <package name="default" namespace="/" extends="struts-default">
            <action name="aaa">
                <result>/index.html</result>
            </action>
            
        </package>
    </struts>

    备注:不小心将 struts.xml 写为 Struts.xml ,就一直出错,郁闷呀

    ----------------------------------- http://www.cnblogs.com/rock_chen/
  • 相关阅读:
    TCP 协议如何解决粘包、半包问题 转载:https://mp.weixin.qq.com/s/XqGCaX94hCvrYI_Tvfq_yQ
    [国家集训队]happiness
    CF592D Super M
    [APIO2010]巡逻
    [NOI2012]美食节
    [JSOI2008]Blue Mary的旅行
    [十二省联考2019]D1T2字符串问题
    [十二省联考2019]D2T2春节十二响
    [十二省联考2019]D1T1异或粽子
    [WC2008]游览计划
  • 原文地址:https://www.cnblogs.com/rock_chen/p/2667788.html
Copyright © 2011-2022 走看看