Class PathInfoMapper
java.lang.Object
org.apache.commons.chain.generic.LookupCommand
org.apache.commons.chain.web.servlet.PathInfoMapper
Command that uses the "path info" component of the request URI
to select a Command from the appropriate Catalog, and
execute it. To use this command, you would typically map an instance
of ChainProcessor to a wildcard pattern like "/execute/*" and
then arrange that this is the default command to be executed. In such
an environment, a request for the context-relative URI "/execute/foo"
would cause the "/foo" command to be loaded and executed.
- Author:
- Craig R. McClanahan
-
Field Summary
FieldsFields inherited from interface Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CataloggetCatalog(Context context) Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryprotected StringgetCommandName(Context context) Look up the extra path information for this request, and use it to select an appropriateCommandto be executed.voidsetCatalogKey(String catalogKey) Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryMethods inherited from class LookupCommand
execute, getCatalogFactory, getCatalogName, getCommand, getName, getNameKey, isIgnoreExecuteResult, isIgnorePostprocessResult, isOptional, postprocess, setCatalogFactory, setCatalogName, setIgnoreExecuteResult, setIgnorePostprocessResult, setName, setNameKey, setOptional
-
Field Details
-
catalogKey
-
-
Constructor Details
-
PathInfoMapper
public PathInfoMapper()
-
-
Method Details
-
getCatalogKey
-
setCatalogKey
-
getCommandName
Look up the extra path information for this request, and use it to select an appropriate
Commandto be executed.- Overrides:
getCommandNamein classLookupCommand- Parameters:
context- Context for the current request- Returns:
- The name of the
Commandinstance - Since:
- Chain 1.2
-
getCatalog
- Overrides:
getCatalogin classLookupCommand- Parameters:
context-Contextfor this request- Returns:
- The catalog.
- Throws:
IllegalArgumentException- if noCatalogcan be found- Since:
- Chain 1.2
-