`

No result defined for action

阅读更多
问题场景:
项目设计模式:SpringMVC
调试程序过程中出现如下异常

异常信息:
com.opensymphony.xwork2.config.ConfigurationException: No result defined for action com.XXX.web.action.ProjectAction and result
    at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374) [xwork-core-2.3.32.jar:2.3.32]
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:276) [xwork-core-2.3.32.jar:2.3.32]

问题分析:
调试代码过程中,ACTION执行突然失效,无法跳转下一个页面,控制台报上面的异常,无法对应指定的出错原因

问题解决:
Debug 模式跟踪,发现在执行调用一个接口时发生异常,无返回值。导致空指针异常,而在ACTION的代码中仅仅有一个打的 try catch 代码块,在 catch 中未做相应的跳转处理,所以程序报错,找不到跳转的位置

问题总结:
不要一个方法里面一个try catch ,用一个 Exception 代表所有。逐个方法,逐个抛出相应异常并打印
try catch finally 处理,如何 if esle 配对出现,处理 if ,有时无需处理 else ,但为了避免出现错误,有if 一定要有 else ,可以仅仅输出一行日志;同理,在 try 中做了跳转处理,在 catch 中同样要考虑如果发生异常了,该如何处理,跳转哪个页面。
分享到:
评论

相关推荐

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

    ### Struts2框架中“No result defined for action and result input”错误解析及解决方法 #### 错误概述 在Struts2框架中开发Web应用程序时,可能会遇到一个名为“No result defined for action and result input...

    No result defined for action.doc

    在IT领域,尤其是在Web开发中,遇到“No result defined for action”这类错误是常见的问题,尤其当使用Struts2框架时更为突出。此类错误通常指向在控制器(Action)中未正确配置或实现结果集(Result),导致请求...

    struts2 的异常收集

    No result defined for action cn.itcast.user.web.action.UserAction and result error ``` 此异常表明在`struts.xml`中没有为指定的动作定义结果。例如,如果期望动作在发生错误时转向特定的JSP页面,但配置文件...

    struts2错误集合.txt

    错误信息:“No result defined for action com.upload.UploadAction and result input”。 这个错误通常是由于配置文件中没有正确定义动作的结果导致的。确保在`struts.xml`中为每个动作定义了合适的`result`标签...

    我的JAVA开发工作笔记

    在提供的内容中提到了一个错误 `No result defined for action com.sxit.smxt.action.XXXAction and result input`。这意味着Struts2框架无法找到对应Action的`input`结果定义。 #### 解决方案: - **检查配置文件*...

    配置struts2常见错误

    No result defined for action ***Action and result success **问题描述**: 当执行某个Action后,出现“没有定义success结果”的错误。 **解决方法**: 这意味着在`struts.xml`中未正确配置`success`结果。为了...

    精心整理的ssh2 一些错误问题的记录(推荐)

    ### 错误八:No result defined for action... and result... 这类错误通常出现在Struts框架中,当在一个动作中定义的结果没有在配置文件(如struts.xml)中正确配置时发生。确保每个动作的结果都在配置文件中有...

    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 ...

    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 ...

    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

    should be disabled, as enabling it may result in issues when generating XML ; documents, however this remains supported for backward compatibility reasons. ; Note that this directive does not control...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    For this reason, the functions that handle these actions offer the option of waiting until the action is complete before returning (so-called synchronous operation); although they can be called in an ...

    polycom宝利通视频会议软件3.9 2018

    (if you are located in the rest of the world) (each referred to individually and collectively herein as “POLYCOM”), for the SOFTWARE PRODUCT (as defined below) licensed by POLYCOM or its suppliers....

    Java邮件开发Fundamentals of the JavaMail API

    Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link ...

    k7 SRIO参考例程

    - CR#477217 / AR#31318 - No longer applicable, v5.1 introduces new buffer. - Core accepts muddled packet when reinitializing during packet receipt - Version fixed : v4.4rev1 - CR#477115 / AR#...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: The result rectangle incorrectly calculated in the TFlexText.GetRefreshRect method. - FIX: Added FPaintCache.rcPaint cleanup in the TFlexPanel.WMPaint method. Now it is possible to define is ...

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

    SQL Server never asks for SIX locks directly, they are always the result of a conversion. For example, suppose a transaction scanned a page using an S lock and then subsequently decided to perform a ...

    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$ ... 命令和参数之间必需用空格隔...

    曲线拟合工具CurveExpert 1.0

    + Cascading a large number of windows would sometimes result in some windows being moved off of the screen. Now, the cascade restarts at the top left if a window might be moved off-screen. + The ...

Global site tag (gtag.js) - Google Analytics