The structure is as follows:
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 >
Note: accidentally write struts. XMLSTruts. XML, keep making mistakes, depressing