sunlabs.brazil.handler

Class MultiProxyHandler

public class MultiProxyHandler extends GenericProxyHandler

Handler for permitting multiple cross connected virtual web sites. Each handler instance adds its prefix and destination to a static hashtable so the URL rewrite rules rewrite all of them correctly.

The {@link GenericProxyHandler} rewrites all of the links in each wepage to point back to the local. machine. Using this handler, if multiple virtual websites are configured, then links in one site that point to other virtual web sites are rewritten to point locally as well.

For example, suppose we have 2 MultiProxyhandlers A and B configured into the server as:

A local request for /foo/bar/test.html will fetch http://www.foo.com/bar/test.html. If the result is an html page, then any links in that page that resolve to www.foo.com/... will be rewritten to the local server as /foo/..., and any links that points to www.bar.com/... will be rewritten to /bar/....

Version: 2.3, 07/03/21

Author: Stephen Uhler

Field Summary
static Hashtableproxies
Holds all proxy -> prefix mappings for this server.
Method Summary
booleaninit(Server server, String prefix)
Initialize this handler.
booleanrespond(Request request)

Field Detail

proxies

public static Hashtable proxies
Holds all proxy -> prefix mappings for this server.

Method Detail

init

public boolean init(Server server, String prefix)
Initialize this handler. Add rewrite mapping into the global table. If any "virtual" web sites reference other "virtual" web sites, then rewrite the links accordingly.

respond

public boolean respond(Request request)