Dynamic Method Invocation (DMI) is a feature of Struts2 framework that lets the "!" (bang) character invoke a method other than `execute`.
Dynamic Method Invocation (DMI) is a feature of Struts2 framework that lets the "!" (bang) character invoke a method other than execute. The "!" character added to the URL after the action name and followed by a method name to execute. The difference with the mapping actions in this way as the opposite where the action is mapped directly to the method in the action configuration the any other method could be executed regardless of the method configured or the method execute
which is used by default.
This feature is configurable by the property or constant struts.enable.DynamicMethodInvocation
which can take values true
or false
. By default this feature is enabled.
Since Struts 2.3, an option was added to restrict the methods that DMI can invoke. You can use the attribute strict-method-invocation="true"
of the package
tag. In this case Struts will reject any method that is not defined in the method
attribute or allowed-methods
of the action
tag.
Documentation: http://struts.apache.org/docs/action-configuration.html#ActionConfiguration-DynamicMethodInvocation