web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
<display-name></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.jsp</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.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd"><!-- START SNIPPET: xworkSample -->
<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="test.LoginAction">
<result name="success" type="redirect">index.jsp</result>
<result name="input">login.jsp</result>
<result name="error">login.jsp</result>
</action>
</package>
</struts><!-- END SNIPPET: xworkSample -->LoginAction.java
package test;import com.opensymphony.xwork2.ActionSupport;public class LoginAction extends ActionSupport { /**
 * 
 */
private static final long serialVersionUID = -5102850352318204106L;
    public String username;
    public String password;
    
    public String execute(){
     if(!username.equals("admin")){
     super.addFieldError("username:", "用户名错误");
     return ERROR;
     }
     if(!username.equals("001")){
     super.addFieldError("password:", "密码错误");
     return ERROR;
     }
     return SUCCESS;
    }
    public void validate(){
     if(username == null||username.length() == 0){
     super.addActionError("用户名不能为空!");
     }
    }
}访问方式:http://localhost:8080/test/login.jsp
问题:
404错误,路径有什么问题?求指点