Versions Compared

Key

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

...

Mappings are matched against the request in the order they appear in the framework's configuration file. If more than one pattern matches the last one wins, so less specific patterns must appear before more specific ones. However, if the request URL can be matched against a path without any wildcards in it, no wildcard matching is performed and order is not important. Also, note that wildcards are not greedy, meaning they only match until the first occurrence of the following string pattern. For example, consider the following mapping:

Code Block
langxml

<action name="List*s" class="actions.List{1}s">
  <result>list{1}s.jsp</result>
</action>

This mapping would work correctly for the URI ListAccounts but not ListSponsors, because the latter would turn into this configuration:

Code Block
langxml

<action name="ListSpons" class="actions.ListSpons">
  <result>listSpons.jsp</result>
</action>

Wildcard patterns can contain one or more of the following special tokens:

*

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 ('\').

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.

...