解决MyEclipse Struts.xml 中通配符报错“xx cannot be found in the namespace”
来源:互联网 发布:激光设备软件开发 编辑:程序博客网 时间:2024/06/05 03:32
我的思路:
首先确定我的 namespace 没有错,用的缺省 namespace=""。
“xx cannot be found in the namespace”,之所以出现类似的错误,
是因为没有一个 actioin 叫做 xx,xx 可以是各种东西,
action、通配符 * 、{xxxx},甚至写错了,压根就不存在的东西等。
如果你非常确定你已经写对了,但 MyEclipse 就是报错,可参考下我的解决方案:
<!-- 所有 action 之上写上,表示默认结果:--><default-action-ref name="default" /><!-- 默认的 action,处理不存在的 action --><action name="default"><result type="redirect">NoSuchAction.html</result><result name="error">NoSuchAction.html</result></action><!-- 随便写一个带通配符的 action 做测试 --><action name="*user" method="{1}"><!-- 动态结果 --><result type="redirectAction">${difference}</result><!-- 动态方法 --><result name="1" type="redirectAction">user!reg</result><!-- 瞎写的 --><result name="2">/写什么都不报错了!.aoi.あおい</result><!-- 异常处理 --><result name="input" type="redirect">index.jsp</result></action><!-- 在最后一个 action 之后写上下面的代码(核心)--><!--为了用 * 匹配 MyEclipse 不能匹配的 --><action name="*"><result type="redirectAction">default</result></action>
同时弊端写就出现了:
如果一不小心写错了,
MyEclipse 也不会给予提示了……
所以请大家自行权衡。
建议在杀青的时候,使用本方案。
- 解决MyEclipse Struts.xml 中通配符报错“xx cannot be found in the namespace”
- Action ***cannot be found in the namespace
- action cannot be found in the namespace/
- struts2报错The Struts dispatcher cannot be found
- JSP 不能用 不支持 STRUTS标签 报错 The Struts dispatcher cannot be found.
- The Struts dispatcher cannot be found. 使用struts标签时该报错的解决方案
- The Struts dispatcher cannot be found in struts2
- The Struts dispatcher cannot be found[未解决]
- 解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found
- struts.xml Included file cannot be found
- The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found....
- The Struts dispatcher cannot be found.
- The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found.
- The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found.
- linux文件系统简介
- 求组合数: 求n个数(1....n)中k个数的组合
- latex表格线的加粗及合并两行
- busybox编译安装
- Upstart管理Ubuntu自启动服务(10.04以后适用)
- 解决MyEclipse Struts.xml 中通配符报错“xx cannot be found in the namespace”
- Highcharts:非常漂亮的图表API
- linux 系统 oracle10 安装与配置
- 数据结构 复习笔记
- 通过注册表修改mac地址
- HDOJ 1106 排序
- Ubuntu system runlevel
- ASM管理和维护札记
- LEDBUTTON类简单描述及总结