[SSH]No result defined for action and result input 和 Struts2中关于值跳转input,而不执行action的问题
来源:互联网 发布:c语言连接字符串 编辑:程序博客网 时间:2024/05/16 11:48
一
今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误就是说没有为返回的input定义,可是有时候我们不一定要用它,然而在Action中出错的话,默认就返回了这个input了,这时,如果我们在struts的<result>
没有定义INPUT的值的话,就出现No result defined for action and resultinput
的错误了。
似乎在struts2.1以上,struts.xml中input这一个值是默认必须定义的,如果你不定义就会出现上面的错误。
二
今天在做项目时,碰到一个问题。当我们跳转Action时,每次都只会跳转input。而不会跳到action中去执行。控制器也没有任何报错,刚开始好郁闷,一直不知道是为了什么。后来到网上查了好多资料,然后才找到原因。
这个原因主要是因为类型不匹配。比如说我们在Action中定义了一个int类型的变量var,但是我们在页面中传递过来的是一个名为var的变量,但是它的值是“ancgdgs”,这样Struts就会尝试将var转换成int类型,但是这个时候无法将这个String类型的值转换成int类型。
再比如我在项目中form里参数定义的是username,password等string类型,但是我在action中初始化的对象为一个实体student对象,这就导致了jsp传的值与action获值的不匹配,于是发生了类型不匹配的问题。
当类型不匹配的情况发生时,struts2就会执行input,返回到input指定的页面。而不去进入Action中执行。
- [SSH]No result defined for action and result input 和 Struts2中关于值跳转input,而不执行action的问题
- [SSH]Struts2 -- No result defined for action and result input
- struts2 No result defined for action.....and result input
- Struts2:No result defined for action XXX and result input
- struts2 no result defined for action xxxx and result input
- struts2的No result defined for action 。。。。and result input 问题
- No result defined for action *Action and result input - action -
- 关于问题“404 No result defined for action XXXAction and result input ”的见解
- No result defined for action and result input 和从excel中导入数据 问题
- 关于"No result defined for action com.ccxe.credit.action.ReportAction and result input"的错误
- 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
- 关于struts2上传文件报错“No result defined for action and result input”
- 关于struts2上传文件报错“No result defined for action and result input”
- 设计模式之翻译模式
- #DeepLearningBook#算法概览之二
- Python yield和Generators(生成器)
- 萌新学习笔记之哈夫曼树
- 工具类List转成数组
- [SSH]No result defined for action and result input 和 Struts2中关于值跳转input,而不执行action的问题
- Ajax学习笔记
- PostgreSql+PostGIS的安装
- 工具类数组转换List
- 异常
- c蓝桥杯高效实现十六进制转八进制
- 【编程开发】非对称加密算法
- mysqldump的一些使用技巧
- BasicLSTMCell