`
yaozuodaoforfly
  • 浏览: 119031 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Wildcard-2

 
阅读更多

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
'\*'

matches the character asterisk ('*'), and

'\\'

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.

Also, the action mapping and action result properties will accept wildcard-matched strings in their value attribute, like:

<action name="/edit/*" class="org.apache.struts.webapp.example.Edit{1}Action">
    <param name="id">{1}</param>
    <result>
      <param name="location">/mainMenu.jsp</param>
      <param name="id">{1}</param> 
    </result>
</action>

 See also Wildcard Method

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics