No result defined for action and result input
来源:互联网 发布:2014年网络作家排行榜 编辑:程序博客网 时间:2024/06/05 03:17
写道
No result defined for action and result input
文章分类:Java编程
今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误想必大家都有遇到过吧,我今天发了很长时间弄这个错误,我以为我的Action函数出错了想调试,但是程序就是不进入断点,上网查资料,有的说路径错误啦,然后我找我的路径错误,搞了半天还是没发现有路径问题。然后我给我的属性的get方法都弄上了断点,我发现了问题,现在跟大家分享。
这个错误就是说没有为返回的input定义,可是有时候我们不一定要这个鬼东西,然而在Action中出错的话,默认就返回了这个input了,这时,我们在struts的<result>中定义的话,就出现No result defined for action and result input的错误了。
引起这个错误的原因是很多的,路径错误也是其中的一种,我这里的问题是,我的页面上的类型和我定义的属性的类型不一致,我的属性是int型的,但是在页面上输出的时候加了一个逗号,用了分割千位的,结果就出现了这个问题了。
文章分类:Java编程
今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误想必大家都有遇到过吧,我今天发了很长时间弄这个错误,我以为我的Action函数出错了想调试,但是程序就是不进入断点,上网查资料,有的说路径错误啦,然后我找我的路径错误,搞了半天还是没发现有路径问题。然后我给我的属性的get方法都弄上了断点,我发现了问题,现在跟大家分享。
这个错误就是说没有为返回的input定义,可是有时候我们不一定要这个鬼东西,然而在Action中出错的话,默认就返回了这个input了,这时,我们在struts的<result>中定义的话,就出现No result defined for action and result input的错误了。
引起这个错误的原因是很多的,路径错误也是其中的一种,我这里的问题是,我的页面上的类型和我定义的属性的类型不一致,我的属性是int型的,但是在页面上输出的时候加了一个逗号,用了分割千位的,结果就出现了这个问题了。
这个问题好像在strtus2.1以上版本才出现, 这个问题的上面的解决方案已经把原因说的差不多了,在实际应用中,我估计大部分情况应该都是在action里面定义了int或者别的什么类型的变量,然后指望struts的自动填装把post来的数据转换,这时容易出现转换失败,从而导致了这个错误,所以查这个错误,可以利用ff的httpfox来查看实际post的参数是什么,然后和action中对应的属性对比,看那个会出现转换错误。
淡然另一种就是上面说的在所有的set 中加入断点,总能看到是哪个方法执行失败的。
另外还有种就是页面提交了同一个名字的参数多个,比如
写道
username 123
username 123
permissions 123
info 31234
username 123
permissions 123
info 31234
页面冲提交了了两个username ,而我的后台却只写了一个String username,这样同样会出错,这个是利用httpfox看的,
其实最好的是action中的和post相对应属性都设置成为String类型,省事,也不会再出现这个错误了,然后在execute中执行转换。这样也方便差错
- No result defined for action *Action and result input - action -
- No result defined for action and result input - action
- No result defined for action action.UploadAction and result input
- No result defined for action *Action and result input
- No result defined for action action.UploadAction and result input
- No result defined for action action.UserAction and result input
- No result defined for action ....Action and result input
- No result defined for action and result input(笔记)
- struts2 No result defined for action.....and result input
- No result defined for action and result input -...
- No result defined for action and result input
- No result defined for action and result input
- No result defined for action and result input
- No result defined for action and result input
- No result defined for action and result input
- No result defined for action and result input
- No result defined for action and result input
- 404:No result defined for action and result input
- jsp学习笔记_编译指令
- 移动手机消息推送机制
- Download Composer
- svm理论与实验之21: 自定义核函数的使用
- Set与List之间转化
- No result defined for action and result input
- 利用python实现新浪微博爬虫 .
- Java中访问权限修饰符public protected private, 缺省默认权限的用法总结
- 3 分钟搞定 Android Push
- pl/sql 条件分支的使用实例
- Mac环境下svn的使用
- Lync 2010升级到2013 之卸载Lync 2010 边缘服务器
- 滤镜之浮雕Emboss
- 【Cocos2d-x】Cocos2d-x参考案例源码解析之三:HelloWorld