I recently fixed several bugs that failed to call DYNAMIC METHODS After struts2.1 was upgraded to 2.3,
However, there is a limitation in my original method, that is, the action written in the submit does not work, even if a dynamic method call is started (I think it should be a bug of struts2.3 ), so to improve this function, I will talk about the js method here.
In <s: submit value = "submit" onclick = "return submitAction ('xx Action')"/>, add the onclick method, and then write in js:
Copy codeThe Code is as follows:
Function submitAction (actionName ){
Name. action = actionName + ". action" of document. form ";
Return true;
}
Or <s: submit value = "submit" onclick = "submitAction ('xx Action')"/>. Note that a return word is missing, and then write in js:
Copy codeThe Code is as follows:
Function submitAction (actionName ){
Name. action = actionName + ". action" of document. form ";
Name. submit ();
}
Now the dynamic method calls of struts2 are basically complete. Please comment and Add.