There is no Action mapped for namespace [/] and action name [test] associated with context path [/s2d]. - [unknown location]

stucts2中错误 找不到文件路径

可能性:

structs.xml 文件(文件名一个字母都不能出错)应该放在 src文件夹下面。具体配置如下:

<?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><!-- extends必须写,直接或者间接继承struts-default name自定义 --><package name="struts" extends="struts-default"><!-- name是请求名称,不要写/;class对应action完全限定名=包名+类名   method: 指定处理类所触发的方法 --><action name="test" class="com.wang.struts2.Test"><!-- result是结果集  name和对应action中的方法的返回值匹配,默认是success --><result name="success">/MyJsp.jsp</result></action></package>
</struts>

配置中的extends="struts-default"  必须写不能错(当然也可以间接继承)

web.xml(在WEB-INF文件夹下)  <filter-name>struts2</filter-name> 这个不能写错切记勿写成structs2

<?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>*.action</url-pattern></filter-mapping><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>
</web-app>

处理类(此处不多说)

package com.wang.struts2;import com.opensymphony.xwork2.Action;public class Test {public String execute(){System.out.println("hello Test");return Action.SUCCESS;}
}

There is no Action mapped for namespace [/] and action name [test] associated with context path [...相关推荐

  1. There is no Action mapped for namespace [/] and action name [LoginAction_home] associ

    使用struts2框架产生的问题: index.jsp: <%@ page language="java" contentType="text/html; char ...

  2. javaweb报错There is no Action mapped for namespace [/] and action name [Login] context path [/struts]

    javaweb报错 There is no Action mapped for namespace [/] and action name [Login] associated with contex ...

  3. There is no Action mapped for namespace / and action name .

    建立一个struts2+hibernate+spring的demo,结果发现输入:http://localhost:端口号/项目名称/ 后,页面报:HTTP Status 404 - There is ...

  4. There is no Action mapped for namespace [/] and action name [] associated with context path [/dxm__s

    2015-4-3 10:23:19 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error 严重: Exception occ ...

  5. Struts2中关于There is no Action mapped for namespace / and action name的错误解决

    今天在调试一个十分基础的Struts2框架小程序时.总是提示"There is no Action mapped for namespace / and action name"的 ...

  6. There is no Action mapped for namespace[/] and action name [] associated with context path.

    There is no Action mapped for namespace[/] and action name [] associated with context path.这是一个很常见的s ...

  7. 关于报错There is no Action mapped for namespace [/] and action name 。。。(两个package的name重复 T_T)

    在使用struts.xml的<include file="***.xml"></include>时,配置了两个xml文件,一直报错,查了网上不少方法,htt ...

  8. message There is no Action mapped for namespace [/] and action name [login] associated with context

    搭建struts工程出现以上问题: 1.排查关键字,xml中是不是有关键字写错 如struts2,default等 2.action 表单  一般要写成 xxxx.action  如:login.ac ...

  9. There is no Action mapped for namespace / and action name accredit.

    No result defined for action XXX and result input 这种错误的原因一般是页面的属性和action里的属性个数.名称.类型不一致造成的. 转载于:http ...

最新文章

  1. CSS中expression使用简介(转载)
  2. eclipse tomcat内存设置
  3. 【重庆】2021年下半年软考报考时间及通知
  4. JS原生 实现图片懒加载
  5. Non-resolvable parent POM
  6. 洛谷1052——过河(DP+状态压缩)
  7. 独立看门狗---STM32----HAL
  8. Linux系统添加永久静态路由的方法
  9. 2011年值得注意的5个设计趋势
  10. 风湿病年鉴 | scRNA-seq研究揭示骨关节炎患者的半月板退变新机制
  11. java属性绑定_java基础:10.1 Java FX与属性绑定
  12. 三层架构之初识庐山真面目
  13. android onscrolllistener判断到底部,android中RecycleView添加下滑到底部的监听示例
  14. TypeScript极速完全进阶指南-2中级篇
  15. TensorFlow安装教程(Windows/Linux两种版本)
  16. 从零实现深度学习框架——过拟合与欠拟合
  17. ubuntu下点击安装VMware tools,没有压缩包文件
  18. BGP超级失误:Verizon 搞垮 Cloudflare 和 AWS 等巨头,导致“连锁灾难性故障”
  19. 漫画:“排序算法” 大总结
  20. python使用CV2剪切图片

热门文章

  1. 纠结做大数据开发?大数据运维?还是大数据分析?
  2. YCM安装以及遇到的坑
  3. Python数据科学库02(matplotlib)
  4. 职场基本功,如何让你的讲话更有条理?
  5. 【html】如何处理显示ttf字体图标
  6. 2022年,保研大数据方向推荐吗?
  7. Excel如何将一张工作表拆分成多个工作表Sheet?
  8. Unity中播放序列图
  9. 仿qq气泡通知粘连效果
  10. mysql的cast函数