Class RequestParameterMapper
java.lang.Object
org.apache.commons.chain.generic.LookupCommand<ServletWebContext>
org.apache.commons.chain.web.jakarta.servlet.RequestParameterMapper
- All Implemented Interfaces:
Command<ServletWebContext>,Filter<ServletWebContext>
Command that uses a specified request parameter
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 path
"/foo.execute?command=bar" would cause the "/bar" 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Catalog<ServletWebContext> getCatalog(ServletWebContext context) Return the context key under which ourCataloghas been stored.protected StringgetCommandName(ServletWebContext context) Look up the specified request parameter for this request, and use it to select an appropriateCommandto be executed.Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryvoidsetCatalogKey(String catalogKey) Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryvoidsetParameter(String parameter) Set the name of the request parameter to use for selecting theCommandto be executed.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
-
Constructor Details
-
RequestParameterMapper
public RequestParameterMapper()The Default-Constructor for this class.
-
-
Method Details
-
getCatalogKey
Return the context key under which ourCataloghas 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 ourCataloghas been stored.- Parameters:
catalogKey- The new catalog key
-
getParameter
Deprecated.Use catalogName to specify the name of the catalog in the catalog factoryReturn the name of the request parameter to use for selecting theCommandto be executed.- Returns:
- The name of the request parameter.
-
setParameter
Set the name of the request parameter to use for selecting theCommandto be executed.- Parameters:
parameter- The new parameter name
-
getCommandName
Look up the specified request parameter for this request, and use it to select an appropriateCommandto be executed.- Overrides:
getCommandNamein classLookupCommand<ServletWebContext>- Parameters:
context- Context for the current request- Returns:
- The name of the
Commandinstance - Since:
- Chain 1.2
-
getCatalog
- Overrides:
getCatalogin classLookupCommand<ServletWebContext>- Parameters:
context-Contextfor this request- Returns:
- The catalog.
- Throws:
IllegalArgumentException- if noCatalogcan be found- Since:
- Chain 1.2
-