public class RegexTargetHandler extends ScopedHandler
This handler applies a list of regex to target name mappings to the URIs of requests.
If the regex matches the URI, then the mapped target name is used in the nested
call to doScope(String, Request, HttpServletRequest, HttpServletResponse).
This handler should be installed as the first handler in a Context. It can be configured
either with direct calls to addPatternTarget(String, String) or by setting
the context init parameters "org.eclipse.jetty.rewrite.handler.REGEX_MAPPINGS" to a comma
separated list of strings in the format regex==target.
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
static String |
REGEX_MAPPINGS |
_nextScope, _outerScope_handler_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING| Constructor and Description |
|---|
RegexTargetHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPatternTarget(String pattern,
String target)
Add a pattern to target mapping.
|
void |
doHandle(String target,
Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
doScope(String target,
Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doStart()
Start the managed lifecycle beans in the order they were added.
|
void |
dump(Appendable out,
String indent) |
handle, never, nextHandle, nextScopedestroy, doStop, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, setHandler, setServerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassdumpThis, getServeraddBean, addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanageaddLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic static final String REGEX_MAPPINGS
public void addPatternTarget(String pattern, String target)
pattern - The regular expression pattern to match.target - The target (normally servlet name) to handle the requestprotected void doStart()
throws Exception
AggregateLifeCycledoStart in class ScopedHandlerExceptionHandlerWrapper.doStart()public void doScope(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doScope in class ScopedHandlerIOExceptionjavax.servlet.ServletExceptionpublic void doHandle(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doHandle in class ScopedHandlerIOExceptionjavax.servlet.ServletExceptionpublic void dump(Appendable out, String indent) throws IOException
dump in interface Dumpabledump in class AbstractHandlerContainerIOExceptionCopyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.