|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.chain.generic.LookupCommand org.apache.commons.chain.web.servlet.RequestParameterMapper
public class RequestParameterMapper
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.
Field Summary |
---|
Fields inherited from interface org.apache.commons.chain.Command |
---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Constructor Summary | |
---|---|
RequestParameterMapper()
|
Method Summary | |
---|---|
protected Catalog |
getCatalog(Context context)
Return the Catalog to look up the Command in. |
String |
getCatalogKey()
Return the context key under which our Catalog has been
stored. |
protected String |
getCommandName(Context context)
Look up the specified request paramater for this request, and use it to select an appropriate Command to be executed. |
String |
getParameter()
Deprecated. Use catalogName to specify the name of the catalog in the catalog factory |
void |
setCatalogKey(String catalogKey)
Deprecated. Use catalogName to specify the name of the catalog in the catalog factory |
void |
setParameter(String parameter)
Set the name of the request parameter to use for selecting the Command to 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.chain.Command |
---|
execute |
Constructor Detail |
---|
public RequestParameterMapper()
Method Detail |
---|
public String getCatalogKey()
Return the context key under which our Catalog
has been
stored.
public void setCatalogKey(String catalogKey)
Set the context key under which our Catalog
has been
stored.
catalogKey
- The new catalog keypublic String getParameter()
Return the name of the request parameter to use for
selecting the Command
to be executed.
public void setParameter(String parameter)
Set the name of the request parameter to use for
selecting the Command
to be executed.
parameter
- The new parameter nameprotected String getCommandName(Context context)
Look up the specified request paramater for this request, and use it
to select an appropriate Command
to be executed.
getCommandName
in class LookupCommand
context
- Context for the current request
Command
instanceprotected Catalog getCatalog(Context context)
Return the Catalog
to look up the Command
in.
getCatalog
in class LookupCommand
context
- Context
for this request
IllegalArgumentException
- if no Catalog
can be found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |