a result represents a possible output. When the method execution of the action class completes, it returns a string type of routing string, which the framework chooses the corresponding result code to output to the user.
A standard set of result codes is defined in the Com.opensymphony.xwork2.Action interface for developers to use, of course Only our action inherits the Actionsupport class to use the following result code , as follows:
public interface Action
{
Publicstatic final String SUCCESS = "SUCCESS";
Publicstatic final String none = "None";
Publicstatic Final String error = "Error";
Publicstatic final String input = "INPUT";
Publicstatic Final String login = "Login";
}
In the course of operation, if you findAddfielderror ()in ainformation orthe type conversion failed orinput checksum failure , etc.
Then it will automatically jump to the name of input <result/>, and then go to the corresponding page of input
If the form in the JSP page is written in normal <form> , the original data disappears when an error occurs and the page is returned
If the form is written in <s:form/> on a JSP page, and the page is returned with an error, the original data still exists
If you do not provide a <result/> with the name value of input, then an error will prompt 404 error in the browser directly
In addition to these predefined result codes, developers can define additional result codes to meet the needs of their own applications
To.
Standard result code in the result of Struts2