org.eclipse.jetty.rewrite.handler
Class RegexTargetHandler
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.handler.ScopedHandler
org.eclipse.jetty.rewrite.handler.RegexTargetHandler
- All Implemented Interfaces:
- Handler, HandlerContainer, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle
public class RegexTargetHandler
- extends ScopedHandler
A handle that uses regular expressions to select the target.
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.
| Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
org.eclipse.jetty.util.component.LifeCycle.Listener |
| Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle |
addBean, addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage |
| Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
REGEX_MAPPINGS
public static final String REGEX_MAPPINGS
- See Also:
- Constant Field Values
RegexTargetHandler
public RegexTargetHandler()
addPatternTarget
public void addPatternTarget(String pattern,
String target)
- Add a pattern to target mapping.
- Parameters:
pattern - The regular expression pattern to match.target - The target (normally servlet name) to handle the request
doStart
protected void doStart()
throws Exception
- Overrides:
doStart in class ScopedHandler
- Throws:
Exception
doScope
public void doScope(String target,
Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
- Specified by:
doScope in class ScopedHandler
- Throws:
IOException
javax.servlet.ServletException
doHandle
public void doHandle(String target,
Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
- Specified by:
doHandle in class ScopedHandler
- Throws:
IOException
javax.servlet.ServletException
dump
public void dump(Appendable out,
String indent)
throws IOException
- Specified by:
dump in interface org.eclipse.jetty.util.component.Dumpable- Overrides:
dump in class AbstractHandlerContainer
- Throws:
IOException
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.