Class PathInfoMapper
- java.lang.Object
-
- org.apache.commons.chain.generic.LookupCommand
-
- org.apache.commons.chain.web.servlet.PathInfoMapper
-
public class PathInfoMapper extends LookupCommand implements Command
Command
that uses the "path info" component of the request URI to select aCommand
from the appropriateCatalog
, and execute it. To use this command, you would typically map an instance ofChainProcessor
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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
catalogKey
-
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
-
-
Constructor Summary
Constructors Constructor Description PathInfoMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Catalog
getCatalog(Context context)
java.lang.String
getCatalogKey()
Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryprotected java.lang.String
getCommandName(Context context)
Look up the extra path information for this request, and use it to select an appropriateCommand
to be executed.void
setCatalogKey(java.lang.String catalogKey)
Deprecated.Use catalogName to specify the name of the catalog in the catalog factory-
Methods inherited from class org.apache.commons.chain.generic.LookupCommand
execute, getCatalogFactory, getCatalogName, getCommand, getName, getNameKey, isIgnoreExecuteResult, isIgnorePostprocessResult, isOptional, postprocess, setCatalogFactory, setCatalogName, setIgnoreExecuteResult, setIgnorePostprocessResult, setName, setNameKey, setOptional
-
-
-
-
Method Detail
-
getCatalogKey
public java.lang.String getCatalogKey()
Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryReturn the context key under which our
Catalog
has been stored.- Returns:
- The context key for the Catalog.
-
setCatalogKey
public void setCatalogKey(java.lang.String catalogKey)
Deprecated.Use catalogName to specify the name of the catalog in the catalog factorySet the context key under which our
Catalog
has been stored.- Parameters:
catalogKey
- The new catalog key
-
getCommandName
protected java.lang.String getCommandName(Context context)
Look up the extra path information for this request, and use it to select an appropriate
Command
to be executed.- Overrides:
getCommandName
in classLookupCommand
- Parameters:
context
- Context for the current request- Returns:
- The name of the
Command
instance - Since:
- Chain 1.2
-
getCatalog
protected Catalog getCatalog(Context context)
- Overrides:
getCatalog
in classLookupCommand
- Parameters:
context
-Context
for this request- Returns:
- The catalog.
- Throws:
java.lang.IllegalArgumentException
- if noCatalog
can be found- Since:
- Chain 1.2
-
-