No result defined for action

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.