Class ServletPathMapper
java.lang.Object
org.apache.commons.chain.generic.LookupCommand<ServletWebContext>
org.apache.commons.chain.web.jakarta.servlet.ServletPathMapper
- All Implemented Interfaces:
Command<ServletWebContext>
,Filter<ServletWebContext>
Command
that uses the "servlet path" 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 an extension pattern like "*.execute" and
then arrange that this is the default command to be executed. In such
an environment, a request for a context relative URI of "/foo.execute"
would cause the "/foo.execute" command to be loaded and executed.- Author:
- Craig R. McClanahan
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Catalog
<ServletWebContext> getCatalog
(ServletWebContext context) Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryprotected String
getCommandName
(ServletWebContext context) Look up the servlet path information for this request, and use it to select an appropriateCommand
to be executed.void
setCatalogKey
(String catalogKey) Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryMethods 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
-
Constructor Details
-
ServletPathMapper
public ServletPathMapper()The Default-Constructor for this class.
-
-
Method Details
-
getCatalogKey
Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryReturn the context key under which ourCatalog
has been stored.- Returns:
- The context key for the Catalog.
-
setCatalogKey
Deprecated.Use catalogName to specify the name of the catalog in the catalog factorySet the context key under which ourCatalog
has been stored.- Parameters:
catalogKey
- The new catalog key
-
getCommandName
Look up the servlet path information for this request, and use it to select an appropriateCommand
to be executed.- Overrides:
getCommandName
in classLookupCommand<ServletWebContext>
- Parameters:
context
- Context for the current request- Returns:
- The name of the
Command
instance - Since:
- Chain 1.2
-
getCatalog
- Overrides:
getCatalog
in classLookupCommand<ServletWebContext>
- Parameters:
context
-Context
for this request- Returns:
- The catalog.
- Throws:
IllegalArgumentException
- if noCatalog
can be found- Since:
- Chain 1.2
-