No result defined for action:
Cause: When the attribute value in the action is null, struts2's default interceptor will report an error, but the input result cannot be found, and the error cannot be returned. Therefore, this error is reported.
Solution:
1. assign default values to null values on the page.
2. redefine an action to remove the member variables with null values.
3. Add the input result and give a prompt on this page.
--------------------------------------------------------------------------
When you use struts2 for development, if no result defined for action and result is reported on the page when you jump from the page to action, most of the reasons are as follows:
1. The validate method is not passed;
2. When page elements are renamed, but the corresponding action class in the background receives the parameter with the same name, the variable is not written as an array.
To check this error, you can
1. Rewrite
Void addactionerror (string anerrormessage)
Void addactionmessage (string amessage)
Void addfielderror (string fieldname, string errormessage)
These three methods are used to set breakpoints in the implementation code, monitor input parameters, and learn the specific causes of page errors.
2. Add the following tags to the page to display the error: <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 );
}
Http://yefei.iteye.com/blog/690079
No result defined for action