在开发中总遇到这个问题,No result defined for action:
原因:Action中的属性值为空的时候,Struts2的默认拦截器会报错,但是又找不到input的Result,不能够把错误返回,所以报这种错误。
解决方法:
1.在页面中给空值赋默认值。
2.重新定义一个Action,去掉空值的成员变量。
3.添加input的Result,并在这个页面给出提示
--------------------------------------------------------------------------
当你在用struts2开发时,如果,从页面跳入action时,页面报No result defined for action and result时,大部分的原因有以下几种:
1、validate方法没有通过;
2、页面元素中有重命名时,但后台action类的对应的接收此同名参数的是变量而没有写成数组
要检查这种错误时,可以
1,在后台action类中重写ActionSupport中的
void addActionError(String anErrorMessage)
void addActionMessage(String aMessage)
void addFieldError(String fieldName, String errorMessage)
这三个方法,在并在其实现代码中设置断点,监控传入的参数,并可获知页面的相关报错具体原因.
2,在页面中加入以下标签,将错误显示出来 :
< div style =”color:red” >
< s:fielderror />
</ div >
--------------------------------------------------------------------------
public void addActionError(String anErrorMessage){
String s=anErrorMessage;
System.out.println(s);
}
public void addActionMessage(String aMessage){
String s=aMessage;
System.out.println(s);
}
public void addFieldError(String fieldName, String errorMessage){
String s=errorMessage;
String f=fieldName;
System.out.println(s);
System.out.println(f);
}
- 浏览: 490085 次
- 来自: ...
最新评论
-
java_doom:
peaceliu 写道 受教了客气了 多谢指教和启发
HAhadoop集群namenode无法自动切换成active -
peaceliu:
受教了
HAhadoop集群namenode无法自动切换成active -
java_doom:
补充一下 在编译hadoop2.9.4时不要改maven源不要 ...
编译hadoop2.7 -
java_doom:
naomibyron 写道我专门注册了一个ITEYE账号,就为 ...
No protocol specified (gedit:2699): Gtk-WARNING **: cannot open display: :0. -
naomibyron:
我专门注册了一个ITEYE账号,就为了对你说声谢谢,对我帮助很 ...
No protocol specified (gedit:2699): Gtk-WARNING **: cannot open display: :0.
相关推荐
jsp\No result defined for action and result input.doc
No result defined for action.doc
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 ...
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 ...
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 ...
- 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 ...
7.16. Protected Result Indications 271 8. Acknowledgements 273 9. References 273 9.1. Normative References 273 9.2. Informative References 274 Appendix A. Changes from RFC 2284 276 Authors’ Addresses...
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...
(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....
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 ...
- 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#...
- 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 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 ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
+ 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 ...
* Caching of result set of code-completion for speed-up. * New option "Execution/Parameters" (and "Debug/Parameters"). Version 4.9.5.0 (5.0 beta 5): * CPU Window (still in development) * ToDo list * ...
创建默认的控制器(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....
date, however, no one has tested if LiDAR returns from water surfaces can be used to measure local water surface slopes within the active channel. Much of the reason that researchers have not ...
4.1 Compiling for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Starting your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
MESSAGE Deforms a surface region using a law defined by a function. SYNONYMS overcrown, global deformation, surface feature HELP DSN_global_shaping_by_function BITMAP globalshaping ACTIONS ...