Recently, I have fixed several bugs in which dynamic method calls fail after upgrading to 2.3, and I have a deep understanding.
However, my original method has a limitation, that is, the action written in submit does not work, and it will not work even if the dynamic method call is started (I think it should be a bug in struts2.3). So in order to improve this function, I will talk about another method using js here.
In <s:submit value="submit" onclick="return submitAction('some action')" />, add the onclick method, and then write it in js:
The code copy is as follows:
function submitAction(actionName){
name.action = actionName+".action" of document.form;
return true;
}
Or <s:submit value="submit" onclick="submitAction('some action')" />, note that there is a missing return word, and then write it in js:
The code copy is as follows:
function submitAction(actionName) {
name.action = actionName+".action" of document.form;
name.submit() of document.form;
}
Now the dynamic method calls of struts2 have basically been improved, please feel free to comment and add.