Class ActionConfigMatcher
- All Implemented Interfaces:
- Serializable
Matches paths against pre-compiled wildcard expressions pulled from action configs. It uses the wildcard matcher from the Apache Cocoon project. Patterns will be matched in the order they exist in the config file. The first match wins, so more specific patterns should be defined before less specific patterns.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionActionConfigMatcher(PatternMatcher<?> patternMatcher, Map<String, ActionConfig> configs, boolean looseMatch) Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes.ActionConfigMatcher(PatternMatcher<?> patternMatcher, Map<String, ActionConfig> configs, boolean looseMatch, boolean appendNamedParameters) Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes.
- 
Method SummaryModifier and TypeMethodDescriptionClones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.Methods inherited from class org.apache.struts2.config.impl.AbstractMatcheraddPattern, convertParam, freeze, match, replaceParameters
- 
Constructor Details- 
ActionConfigMatcherpublic ActionConfigMatcher(PatternMatcher<?> patternMatcher, Map<String, ActionConfig> configs, boolean looseMatch) Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the config file. Only paths that actually contain a wildcard will be compiled. 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. - Parameters:
- patternMatcher- pattern matcher
- configs- An array of ActionConfig's to process
- looseMatch- To loosely match wildcards or not
 
- 
ActionConfigMatcherpublic ActionConfigMatcher(PatternMatcher<?> patternMatcher, Map<String, ActionConfig> configs, boolean looseMatch, boolean appendNamedParameters) Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the config file. Only paths that actually contain a wildcard will be compiled. 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. - Parameters:
- patternMatcher- pattern matcher
- configs- An array of ActionConfig's to process
- looseMatch- To loosely match wildcards or not
- appendNamedParameters- To append named parameters or not
- Since:
- 2.5.23 See WW-5065
 
 
- 
- 
Method Details- 
convertClones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings. - Specified by:
- convertin class- AbstractMatcher<ActionConfig>
- Parameters:
- path- The requested path
- orig- The original ActionConfig
- vars- A Map of wildcard-matched strings
- Returns:
- A cloned ActionConfig with appropriate properties replaced with wildcard-matched values
 
 
-