JAVA web项目中的no result defined for action result input 错误
来源:互联网 发布:python 2 3区别 编辑:程序博客网 时间:2024/06/02 06:16
No result defined for action and result input
产生这个错误的原因:Action中的属性值为空的时候,Struts2的默认拦截器会报错,但是又找不到input的Result,不能够把错误返回,所以报这种错误。
今天在在写项目中表单的修改功能时,出现了这个错误,一开始找不到头绪,以为是配置文件错了,看了好多遍都没有发现错误,在火狐浏览器中的firebug调试中看到了错误信息是Action没有找到,不应该的,配置文件没有问题。
上网找资料的时候看见有人说是可能是因为:
1、validate方法没有通过;
2、页面元素中有重命名时,但后台action类的对应的接收此同名参数的是变量而没有写成数组
页面元素我知道没有重名,但是validate是跟添加数据共用的,如果有错误为什么添加的时候没有报错了。
看了下表单的ID ,修改的表单ID跟添加的表单ID是一样的,不过这两个是在不同的JSP文件中,应该不存在冲突,我在想是不是浏览器缓存的问题,从服务器上加载js文件可能出现问题,我试着在页面中输入一些错误的信息,发现validate.js并没有提示出错,有时候输入正确信息js验证依然报错,我在想可能就是这个验证问题了,
试着把修改和添加两个界面的表单ID改了(当时实在是没有其他办法了),重启服务器,发现修改能够顺利提交了。
值得警惕的是:删除过程中也出现了同样的错误
信息显示deleteAction中没有result return 这应该是配置文件错了,找到Action中并没错误,那么肯定是ACtion 中返回值出现了错误,果然,Action中返回值出现了错误。
从上面可知,能够导致 No result defined for action result input 这种错误可能是因为:
1、validate方法没有通过(表单验证看看有没有重名,导致js文件加载过慢);
2、页面元素中有重命名时,但后台action类的对应的接收此同名参数的是变量而没有写成数组
3、配置文件中result 返回.jsp出现错误(多了空格、或者没有界面)
4、对应Action中没有返回值,或者返回值出错
前几天一直以为validate验证错误是因为没有加载而导致错误,其实不是的,最初的错误是因为,我的修改页面的数据是从数据库中取出来的,string类型的还好,如果是float 型 为空值的话在页面上面就会显示null字符串,为了美观,决定在getvalue()之后判断一下是否为null 如果为null的话,我居然让它为“ ”,所以导致页面加载完之后有的float项变成了“ ”,所以提交的时候就报错了。。。。
今天字、进、
- JAVA web项目中的no result defined for action result input 错误
- JAVA web项目中的no result defined for action xxxAction and result input 错误
- Java Web 的No result defined for action cn.itcast.action.CustomerAction and result input 错误
- No result defined for action result input的错误
- 404-No result defined for action and result input 错误
- No result defined for action result input
- 关于Struts2中的No result defined for action and result input错误
- 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 com.ccxe.credit.action.ReportAction and result input"的错误
- Struts2——No result defined for action and result input - action错误
- No result defined for action action.UploadAction and result input(开发错误记录struts2)
- No result defined for action com.igit.contract.web.action.ContContractAction and result input
- 如何查看和设置ADF日志
- ehcache 的 diskStore
- 使用ADF实现基于Form的CRUD (1)
- 使用keytool生成ssl密钥文件keystore和truststore
- zoj-3197-Google Book
- JAVA web项目中的no result defined for action result input 错误
- 使用ADF实现基于Form的CRUD (2)
- OpenCV配置(64位 vs2010)
- POJ 3623 Best Cow Line, Gold(模拟)
- 2014-08-19 19:33:41
- HDU 4965 Fast Matrix Calculation 矩阵快速幂
- 使用ADF实现基于Form的CRUD (3)
- Codeforces 4C (STL map)
- 如何在ADF页面中显示警告信息?