com.ibm.wbi.protocol.http.beans
Class KeepOnServerEditor

com.ibm.wbi.Meg
  |
  +--com.ibm.wbi.Editor
        |
        +--com.ibm.wbi.protocol.http.HttpEditor
              |
              +--com.ibm.wbi.protocol.http.beans.KeepOnServerEditor

public class KeepOnServerEditor
extends HttpEditor

Keep On Server Editor Edit the links on a page so they go through the server. This is useful if WBI is running in server mode rather than in proxy mode. "Proxy mode" means that the web browser is configured to use WBI as an HTTP proxy. In proxy mode, every HTTP transaction goes through WBI, regardless of the URL. "Server mode" means the web browser is not configured to use WBI as a proxy, and rather makes requests to the WBI as it would any other web server. It is possible for WBI to act just as a web server in this mode, but it is also possible to tunnel requests to another server, and rewrite the links to make them look like they came from the WBI server, to make the client "keep on the WBI server". For example, a link to http://www.ibm.com might be rewritten to http://my.wbi.server/tunnel?url=http://www.ibm.com. To accomplish the affect of using WBI in "server mode", it is necessary to handle redirects and error conditions properly, and to actually edit the links in the document. This bean uses a LinkProcessor to rewrite the links. The LinkProcessor is generic, and itself turn relies on an implementation LinkRewriter to enumerate the policies of how links should be rewritten.

See Also:
LinkProcessor, LinkRewriter

Fields inherited from class com.ibm.wbi.protocol.http.HttpEditor
COPYRIGHT
 
Fields inherited from class com.ibm.wbi.Meg
EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
KeepOnServerEditor(java.lang.Class lrclass, java.lang.Object lrinit)
          Construct a new instance of the KeepOnServerEditor.
 
Method Summary
 void handleRequest(RequestEvent e)
          Handle the request by editing the page, calling the link rewriting.
 
Methods inherited from class com.ibm.wbi.Editor
getType
 
Methods inherited from class com.ibm.wbi.Meg
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup
 

Constructor Detail

KeepOnServerEditor

public KeepOnServerEditor(java.lang.Class lrclass,
                          java.lang.Object lrinit)
Construct a new instance of the KeepOnServerEditor.
Parameters:
lrclass - The class of your LinkRewriter
lrinit - An object used to initialize the LinkRewriter
See Also:
LinkRewriter
Method Detail

handleRequest

public void handleRequest(RequestEvent e)
                   throws RequestRejectedException,
                          java.io.IOException
Handle the request by editing the page, calling the link rewriting.
Overrides:
handleRequest in class HttpEditor
Parameters:
e - The RequestEvent object
Throws:
RequestRejectedException - thrown if an error response is received