|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.config.ActionConfigMatcher
public class ActionConfigMatcher
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 Struts config file. The last match wins, so more specific patterns should be defined after less specific patterns.
Constructor Summary | |
---|---|
ActionConfigMatcher(ActionConfig[] configs)
Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. |
Method Summary | |
---|---|
protected ActionConfig |
convertActionConfig(String path,
ActionConfig orig,
Map vars)
Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings. |
protected String |
convertParam(String val,
Map vars)
Inserts into a value wildcard-matched strings where specified. |
ActionConfig |
match(String path)
Matches the path against the compiled wildcard patterns. |
protected void |
replaceProperties(Properties orig,
Properties props,
Map vars)
Replaces placeholders from one Properties values set to another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionConfigMatcher(ActionConfig[] configs)
Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the Struts config file. Only paths that actually contain a wildcard will be compiled.
configs
- An array of ActionConfig's to processMethod Detail |
---|
public ActionConfig match(String path)
Matches the path against the compiled wildcard patterns.
path
- The portion of the request URI for selecting a config.
protected ActionConfig convertActionConfig(String path, ActionConfig orig, Map vars)
Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.
path
- The requested pathorig
- The original ActionConfigvars
- A Map of wildcard-matched strings
protected void replaceProperties(Properties orig, Properties props, Map vars)
Replaces placeholders from one Properties values set to another.
orig
- The original properties set with placehold valuesprops
- The target properties to store the processed valuesvars
- A Map of wildcard-matched stringsprotected String convertParam(String val, Map vars)
Inserts into a value wildcard-matched strings where specified.
val
- The value to convertvars
- A Map of wildcard-matched strings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |