Wildcard Mappings

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

*

Matches zero or more characters excluding the slash ('/') character.

**

Matches zero or more characters including the slash ('/') character.

\character

The backslash character is used as an escape sequence. Thus

No Format
'\*'

matches the character asterisk ('*'), and

No Format
'\\'

matches the character backslash ('\').

Note

Patterns can optionally be matched "loosely". When the end of the pattern matches *[^*]*$ (wildcard, no wildcard, wildcard), if the pattern fails, it is also matched as if the last two characters didn't exist. The goal is to support the legacy "*!*" syntax, where the "!*" is optional.

In the action mapping and action results, the wildcard-matched values can be accessed with the token {N} where N is a number from 1 to 9 indicating which wildcard-matched value to substitute. The whole request URI can be accessed with the {0} token.

...

From 2.1.9+ regular expressions can be defined defined in the action name. To use this form of wild card, the followign following constants must be set:

Code Block
xml
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.patternMatcher" value="regex" />

...