`

No result defined for action and result input

阅读更多
写道
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型的,但是在页面上输出的时候加了一个逗号,用了分割千位的,结果就出现了这个问题了。

 这个问题好像在strtus2.1以上版本才出现, 这个问题的上面的解决方案已经把原因说的差不多了,在实际应用中,我估计大部分情况应该都是在action里面定义了int或者别的什么类型的变量,然后指望struts的自动填装把post来的数据转换,这时容易出现转换失败,从而导致了这个错误,所以查这个错误,可以利用ff的httpfox来查看实际post的参数是什么,然后和action中对应的属性对比,看那个会出现转换错误。

    淡然另一种就是上面说的在所有的set 中加入断点,总能看到是哪个方法执行失败的。

    另外还有种就是页面提交了同一个名字的参数多个,比如

写道
username 123
username 123
permissions 123
info 31234

 页面冲提交了了两个username ,而我的后台却只写了一个String username,这样同样会出错,这个是利用httpfox看的,

    其实最好的是action中的和post相对应属性都设置成为String类型,省事,也不会再出现这个错误了,然后在execute中执行转换。这样也方便差错

分享到:
评论
7 楼 waykingeye 2015-03-20  
[i][b][u]
引用
[list]
[*][img][url][*][*]
  • [*]
    [flash=200,200][url][img][list]
    [*]
    引用
    [b][i][u][/u][/i][/b]
    [/list][/img][/url][/flash]
    [/url][/img][/list]
    [/u][/b][/i]
    6 楼 tss0823 2015-03-18  
    5 楼 yahier 2014-11-10  
    有什么办法能够捕捉,然后给出自定义的提示呢
    4 楼 dabing69221 2013-05-19  
    同样的问题,哎,老是犯低级错误  
    3 楼 wuhuanhost 2013-01-22  
    唉!同样的错误!谢谢你的博文帮我解决了,有时候就是被这些不注意的地方出现的问题给卡住。
    2 楼 yu165683 2011-11-08  
    3q 问题解决了, 犯了个初级错误
    1 楼 lvhongfen 2011-11-02  


    哎……,我昨天找了这个问题找了一个下午,它死活不走Action,
    就是报这个错!

    原来是我的定义的对象里面有一个属性是Integer类型的
    但我在<s:textFiled/>标签里面输入的是字符串导致的
    看来我需要在页面上加JS验证了!

    很感谢LZ,谢谢分享经验,不然这个令人头疼的问题,我还真不知道如何下手了呢!

    相关推荐

      jsp\No result defined for action and result input.doc

      jsp\No result defined for action and result input.doc

      a project model for the FreeBSD Project.7z

      There is no defined model for how people write code in FreeBSD. However, Niels Jørgenssen has suggested a model of how written code is integrated into the project. Figure 4-1. Jørgenssen's model ...

      LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

      The VariSpec always processes each command to completion before starting on the next command, and it has a 256 byte input buffer, so there is no problem issuing several commands at once; they will all...

      PMBOK 2008 English Version

      The Project Manager is responsible for the project objectives to deliver the final product that has been defined, within the constraints of project scope, time, cost and required quality. Strengths...

      struts_2.3.12GA_API文档(chm版本)

      Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return the specified result, such as Action.SUCCESS, Action.INPUT, etc. void ...

      微软内部资料-SQL性能优化3

      For example, if T1 writes some object that is in T2’s input or output set, there is a dependency between T1 and T2. Bad Dependencies These include lost updates, dirty reads, non-repeatable reads, ...

      Debugging with GDB --2002年5.11

      r Your program's input and output file:///C|/gdb.html (1 of 352)19. 1. 2004 20:32:03 Debugging with GDB Debugging an already-running process r Killing the child process r Debugging programs with ...

      BURNINTEST--硬件检测工具

      - Minor changes to the No operation error watchdog timer for the CD and Hard disk tests. - Minor correction to the Butterfly seek test. - Video playback trace logging increased. Release 5.3 build ...

      php.ini-development

      of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a ; previously set variable or directive (e.g. ${...

      Java邮件开发Fundamentals of the JavaMail API

      framework adds support for typing arbitrary blocks of data and handling it accordingly. This doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools ...

      2009 达内Unix学习笔记

      集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

      QTP下载链接.txt

      Action是QTP组织测试用例的具体形式,拥有自己的DataTable和Object Repository,支持Input和output参数。Action可以设置为share类型的,这样可以被其他test中的Action调用(注意:QTP是不支持在一个test中调用另外一...

      ZendFramework中文文档

      创建默认的控制器(Action Controller) 7.1.2.6. 创建你的视图脚本 7.1.2.7. 创建你自己的错误控制器 7.1.2.8. 访问站点! 7.2. Zend_Controller 基础 7.3. 前端控制器 7.3.1. 概述 7.3.2. 主要方法 7.3....

      DebuggingWithGDB 6.8-2008

      4.6 Your Program’s Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Debugging an Already-running Process . . . . . . . . . . . . . . . . . . . . . . 4.8 Killing the Child ...

      iPod+Authentication+Coprocessor+Spec+2.0C+R1

      For further information about authenticating Apple devices and their attached accessories, see apple's MFi Accessory Firmware Specification and MFi Accessory Hardware Specification Related documents 9...

      Software Testing and Continuous Quality Improvement

      Software Testing and Continuous Quality Improvement &lt;br&gt;SECTION I SOFTWARE QUALITY IN PERSPECTIVE . . . . . . . . . . . . . . . 1 1 Quality Assurance Framework. . . . . . . . . . . . . . . . . ....

      UG6.0快捷键大全

      MESSAGE Changes the density and the density units for a solid body. SYNONYMS edit mass, thickness, solid property HELP DSN_solid_density BITMAP editsoliddensity ACTIONS STANDARD SEPARATOR ...

      Debugging with GDB --2003年6.0

      Your program’s input and output . . . . . . . . . . . . . . . . . . . . . . . . Debugging an already-running process . . . . . . . . . . . . . . . . . . . Killing the child process . . . . . . . . . ...

      Debugging with GDB --2001年5.3

      Your program’s input and output . . . . . . . . . . . . . . . . . . . . . . . . Debugging an already-running process . . . . . . . . . . . . . . . . . . . Killing the child process . . . . . . . . . ...

    Global site tag (gtag.js) - Google Analytics