org.mortbay.http.handler

Class ForwardHandler

public class ForwardHandler extends AbstractHttpHandler

Forward Request Handler. Forwards a request to a new URI. Experimental - use with caution.

Version: $Revision: 1.16 $

Author: Greg Wilkins (gregw)

Constructor Summary
ForwardHandler()
Constructor.
ForwardHandler(String rootForward)
Constructor.
Method Summary
voidaddForward(String pathSpecInContext, String newPath)
Add a forward mapping.
voidhandle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response)
voidsetHandleQueries(boolean b)
Set the Handler up to cope with forwards to paths that contain query elements (e.g.
voidsetRootForward(String newPath)
Add a forward mapping for root path.

Constructor Detail

ForwardHandler

public ForwardHandler()
Constructor.

ForwardHandler

public ForwardHandler(String rootForward)
Constructor.

Parameters: rootForward

Method Detail

addForward

public void addForward(String pathSpecInContext, String newPath)
Add a forward mapping.

Parameters: pathSpecInContext The path to forward from newPath The path to forward to.

handle

public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response)

setHandleQueries

public void setHandleQueries(boolean b)
Set the Handler up to cope with forwards to paths that contain query elements (e.g. "/blah"->"/foo?a=b").

Parameters: b

setRootForward

public void setRootForward(String newPath)
Add a forward mapping for root path. This allows a forward for exactly / which is the default path in a pathSpec.

Parameters: newPath The path to forward to.

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.