HTTP Status 404 - No result defined for action解决方法
来源:互联网 发布:人工智能电影排名 编辑:程序博客网 时间:2024/04/29 06:59
这种错误的产生原因可能如下:
1、validate方法没有通过;
2、页面元素中有重命名时,但后台action类的对应的接收此同名参数的是变量而没有写成数组,这个极有可能,我就碰到过,搞了好久才发现是这个原因
要检查这种错误时,可以
1,在后台action类中重写ActionSupport中的
void addActionError(String anErrorMessage)
void addActionMessage(String aMessage)
void addFieldError(String fieldName, String errorMessage)
这三个方法,在并在其实现代码中设置断点,监控传入的参数,并可获知页面的相关报错具体原因.
2,在页面中加入以下标签,将错误显示出来:
<div style=”color:red”>
<s:fielderror />
</div>
struts2.1.8 必须配置namespace
在2.0中一切OK,没有问题,但是在2.1中确出现了No result defined for action的异常,郁闷了好半天,经过多方查找,原来是在2.1中有一个插件struts2-convention-plugin-2.1.8.jar,这个插件是2.1版本中新添加的默认核心包,这个插件是实现Struts2的零配置,但是这样问题就来了,如果引入就必须引入namespace命名空间,否则就会出现刚才的No result defined for action的异常
解决办法:
1、在stuts.xml中加上以下代码:
<result name="input"></result>
这种办法并不是从根本上解决问题。因为No result defined for action and result其实是一种执行失败的情况,他需要一个名为input 的result来处理这种操作失败的情况
,现在它找不着,所以就报了No result defined for action and result的异常。
2、应该从根本上去找导致这种情况的失败原因。
如:在JSP中写上<s:hidden name="id" value="id"></s:hidden>,这时加入你Aaction里面写的是一个Long或者其他整数型的id,那么就肯定会抱着个错误。
- HTTP Status 404 - No result defined for action解决方法
- HTTP Status 404 - No result defined for action解决方法
- “HTTP Status 404 - No result defined for action ****** and result result”错误解决方法
- “HTTP Status 404 - No result defined for action ****** and result result”错误解决方法
- HTTP Status 404 - No result defined for action
- HTTP Status 404 - No result defined for action
- HTTP Status 404 - No result defined for action com.lnzkx.action.PeronAction and result success
- HTTP Status 404 - No result defined for action com.ssk.action.Register and result success
- HTTP Status 404 - No result defined for action com.cnlive.csp.manage.action.SysGiftAction and result
- HTTP Status 404 - No result defined for action com.tencent.action.UserAction and result success
- HTTP Status 404 - No result defined for action org.csun.ns.action.NtHomesAction and result input
- HTTP Status 404-no result defined for action com.huida.action.LinkManAction and result input
- HTTP Status 404 - No result defined for action XXXX and result success 处理
- HTTP Status 404 - No result defined for action and result input
- HTTP Status 404 - No result defined for action …… and result input。
- struts2 上传文件 HTTP Status 404 - No result defined for action.....and result input
- HTTP Status 404 - No result defined for action XXXX and result success 处理
- HTTP Status 404 - No result defined for action XXX and result input
- Servlet
- 新开始
- 40、微信-搜索好友及公众号页面SearchActivity
- IE8以下的attachEvent()和其他浏览器的addEventListener()区别
- 算法题--答案仅供参考
- HTTP Status 404 - No result defined for action解决方法
- 41、微信-添加新朋友NewFriendsListActivity
- 选择文本触发事件
- RTSP消息详解
- 快速定位crash的炫酷方式
- 时间戳的格式,直接影响时间戳的正确与否
- 42、微信-添加新朋友列表适配器
- Linux常用命令
- dimension适配