Struts2 与上下文路径[/HelloWorld]关联的命名空间[/]和操作名称[login]没有映射的操作

Struts2 与上下文路径[/HelloWorld]关联的命名空间[/]和操作名称[login]没有映射的操作,struts2,action-mapping,Struts2,Action Mapping,在那里。我是struts2的初学者。我在eclipse上创建了一个动态web项目,以便使用struts 2。它有点问题,我就是不知道为什么。 控制台输出为: 找不到操作或结果与上下文路径[/HelloWorld]关联的命名空间[/]和操作名[login]没有映射操作[未知位置] 我有下面的目录结构 -HelloWorld -JavaResources -src -com.ls.action -LoginAction -struts.xml +bulild

在那里。我是struts2的初学者。我在eclipse上创建了一个动态web项目,以便使用struts 2。它有点问题,我就是不知道为什么。 控制台输出为: 找不到操作或结果与上下文路径[/HelloWorld]关联的命名空间[/]和操作名[login]没有映射操作[未知位置] 我有下面的目录结构

-HelloWorld
-JavaResources
  -src
     -com.ls.action
        -LoginAction
     -struts.xml
+bulild
-WebContent
  +META-INF
  -WEB-INF
     +lib
     -web.xml    
  -login.jsp
  -welcome.jsp
  -fail.jsp
我的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">
    <struts>
        <package name="helloWorld" namespace="/" extends="struts-default">
            <action name="Login" class="com.ls.action.LoginAction">
                <result>/welcome.jsp</result>
                <result name="error">/fail.jsp</result>
            </action>
        </package>
    </struts>

/welcome.jsp
/fail.jsp
我的web.xml文件是:


支柱2
org.apache.struts2.dispatcher.ng.filter.strutspreadexecutefilter
支柱2
/*
login.jsp
我的login.jsp文件是


登录
登录
用户名: 密码:
您有任何错误吗?也不要弄乱登录和欢迎文件。我没有看到任何错误,我会检查一下。谢谢请记住,url中使用了操作名称和命名空间,因此url和这些名称区分大小写。也检查一下。
<?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">
  <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>login.jsp</welcome-file>
  </welcome-file-list>
</web-app>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Login</title>
  </head>

  <body>
    <h3>Login</h3> <hr/>
    <form action="login.action" method="post">
        <table>
            <tr>
                <td>username:</td>
                <td><input type="text" name="userName"></td>
            </tr>
            <tr>
                <td>password:</td>
                <td><input type="text" name="password"></td>
            </tr>
            <tr>
            <td colspan="2">
                <input type="submit" value="submie">&nbsp;&nbsp;
                <input type="reset" value="reset">
            </td>
        </table>
    </form>
  </body>
</html>