com.arsdigita.dispatcher
Interface ChainedDispatcher
- public interface ChainedDispatcher
This interface defines
a dispatcher that is intended to be chained together with other dispatchers.
The functional difference between ChainedDispatcher and Dispatcher is
that a ChainedDispatcher's chainedDispatch() method can return a status
code to indicate that it was successful or unsuccessful in finding
a resource to dispatch to.
This interface is mainly used in conjunction with
DispatcherChain, a general-purpose dispatcher that joins many
different ChainedDispatchers together in a chain of different
URL-to-resource mappings; if one cannot find a resource, the next
one is tried. This is useful when an application has several
different methods to find a resource for a URL and each method can
be separated into a re-usable module.
For example, suppose an application resolves a URL to a resource
like this:
- try to serve a file /templates/$site-node/$page.jsp
- if not found, try to serve a Bebop Page mapped to $page
- if not found, try to serve a file /packages/$key/www/$page.jsp
- if not found, serve "not found" page
If we implement each stage as a separate ChainedDispatcher, then we
can mix and match these dispatch stages in any number of
applications.
- Since:
- 4.6.6
- Version:
- $Revision: #9 $ $Date: 2004/04/07 $
- Author:
- Bill Schneider
Method Summary |
int |
chainedDispatch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
RequestContext actx)
Dispatch this request and return a status code if
successful. |
versionId
public static final String versionId
- See Also:
- Constant Field Values
DISPATCH_BREAK
public static final int DISPATCH_BREAK
- See Also:
- Constant Field Values
DISPATCH_CONTINUE
public static final int DISPATCH_CONTINUE
- See Also:
- Constant Field Values
chainedDispatch
public int chainedDispatch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
RequestContext actx)
throws IOException,
javax.servlet.ServletException
- Dispatch this request and return a status code if
successful.
- Parameters:
request
- The servlet request objectresponse
- the servlet response objectactx
- The request context
- Returns:
- DISPATCH_BREAK if dispatch successful, DISPATCH_CONTINUE
if no resource found (try next dispatcher in chain)
- Throws:
IOException
javax.servlet.ServletException
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC