Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Another common approach is to " postfix " the method name and set it off with an exclamation point (aka "bang") or other special character.

  • "action=Crud!input"
  • "action=Crud!delete"

To use this sort of referencea postfix-bang idiom, just move the asterisk and add a bang.

Code Block
xml
xml

<action name="Crud!*" class="example.Crud" method="{1}">

From the framework's perspective, a wildcard mapping creates a new "virtual" mapping with all the same attributes as a conventional, static mapping. As a result, you can use the expanded wildcard name as the name of validation, type conversion, and localization files, just as if it were an Action name (which it is!).

  • Crud!input-validation.xml
  • Crud!delete-conversion.xml

...

(minus) The "!" notation is also available in WebWork 2, but it is implemented differently. To use the old implementation, set

...

struts.enable.DynamicMethodInvocation=TRUE in the

...

struts.properties file. To use wildcards instead (preferred), set

...

struts.enable.DynamicMethodInvocation=FALSE.

ActionSupport Default

If the class attribute in an action mapping is left blank, the com.opensymphony.xwork.ActionSupport class is used as a default.

...