Struts2中关于"There is no Action mapped for namespace / and action name"的错误解决
来源:互联网 发布:淘宝c店铺运营计划表 编辑:程序博客网 时间:2024/06/04 18:19
今天在调试一个十分基础的Struts2框架小程序时。总是提示”There is no Action mapped for namespace / and action name”的错误。找了好长时间也没解决,灰常苦恼。最终,竟然是一个小小的拼写错误,蓝瘦香菇。这是一个初学者经常碰到的问题,导致错误的原因主要有两种。总结如下:
1.—–首先查看你的struts.xml 文件是否在src目录下;
最重要的是还要检查struts是否拼写错误。(我就是因为这个的拼写错误才出现这样的问题的)
2.—–检查struts.xml文件的语法是否正确:
如果1检查之后没有错误,那基本就是语法的问题了。
<?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> <package name="default" namespace = "/" extends="struts-default"> <action name="save" class="org.action.SaveAction"> <result name="success">/success.jsp</result> <result name="error">/index.jsp</result> </action> </package></struts>
其中,
namespace 属性是可选的, 如果它没有给出, 则以 “/” 为默认值. 若 namespace 有一个非默认值, 则要想调用这个包里的Action, 就必须把这个属性所定义的命名空间添加到有关的 URI 字符串里
action 元素的 class 属性是可选的. 如果没有配置 class 属性, Struts 将把 com.opensymphony.xwork2.ActionSupport 作为其默认值. 如果配置了 class 属性, 还可以使用 method 属性配置该类的一个动作方法. method 属性的默认值为 execute
1 0
- Struts2中关于"There is no Action mapped for namespace / and action name"的错误解决
- Struts2中关于"There is no Action mapped for namespace / and action name"错误
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的问题
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- 九种浏览器端缓存方法知多少
- 马的遍历问题—贪心跑图
- js数组的一些方法join,split,sort
- 环境变量无效
- php 图像裁剪(自定义裁剪图片大小)
- Struts2中关于"There is no Action mapped for namespace / and action name"的错误解决
- Linux中一些常用命令
- 我花50元赚来190元的贴吧推广经验
- oracle用expdp导出数据库用户
- selenium:chromedriver与chrome版本的对应关系
- 单点登录(手写php代码)
- 圈复杂度
- 图片超过边框大小时截取图片中间部分
- Android广告图片轮播控件,支持无限循环和5种主题,可以灵活设置轮播样式、时间、位置、图片加载框架等!