org.apache.commons.chain.web.servlet
Class PathInfoMapper

java.lang.Object
  extended byorg.apache.commons.chain.web.servlet.PathInfoMapper
All Implemented Interfaces:
Command

public class PathInfoMapper
extends Object
implements Command

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

Constructor Summary
PathInfoMapper()
           
 
Method Summary
 boolean execute(Context context)
          Look up the extra path information for this request, and use it to select an appropriate Command to be executed.
 String getCatalogKey()
          Return the context key under which our Catalog has been stored.
 void setCatalogKey(String catalogKey)
          Set the context key under which our Catalog has been stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathInfoMapper

public PathInfoMapper()
Method Detail

getCatalogKey

public String getCatalogKey()

Return the context key under which our Catalog has been stored.


setCatalogKey

public void setCatalogKey(String catalogKey)

Set the context key under which our Catalog has been stored.

Parameters:
catalogKey - The new catalog key

execute

public boolean execute(Context context)
                throws Exception

Look up the extra path information for this request, and use it to select an appropriate Command to be executed.

Specified by:
execute in interface Command
Parameters:
context - Context for the current request
Returns:
true if the processing of this Context has been completed, or false if the processing of this Context should be delegated to a subsequent Command in an enclosing Chain
Throws:
Exception - general purpose exception return to indicate abnormal termination


Copyright © 2003-2005 The Apache Software Foundation. All Rights Reserved.