org.mortbay.servlet
Class ProxyServlet.Transparent

java.lang.Object
  extended by org.mortbay.servlet.ProxyServlet
      extended by org.mortbay.servlet.ProxyServlet.Transparent
All Implemented Interfaces:
Servlet
Enclosing class:
ProxyServlet

public static class ProxyServlet.Transparent
extends ProxyServlet

Transparent Proxy. This convenience extension to AsyncProxyServlet configures the servlet as a transparent proxy. The servlet is configured with init parameter:

For example, if a request was received at /foo/bar and the ProxyTo was http://host:80/context and the Prefix was /foo, then the request would be proxied to http://host:80/context/bar


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mortbay.servlet.ProxyServlet
ProxyServlet.Transparent
 
Field Summary
 
Fields inherited from class org.mortbay.servlet.ProxyServlet
_config, _context, _DontProxyHeaders
 
Constructor Summary
ProxyServlet.Transparent()
           
ProxyServlet.Transparent(String prefix, String server, int port)
           
 
Method Summary
 void init(ServletConfig config)
           
protected  URL proxyHttpURL(String scheme, String serverName, int serverPort, String uri)
          Resolve requested URL to the Proxied URL
 
Methods inherited from class org.mortbay.servlet.ProxyServlet
destroy, getServletConfig, getServletInfo, handleConnect, service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyServlet.Transparent

public ProxyServlet.Transparent()

ProxyServlet.Transparent

public ProxyServlet.Transparent(String prefix,
                                String server,
                                int port)
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Specified by:
init in interface Servlet
Overrides:
init in class ProxyServlet
Throws:
ServletException

proxyHttpURL

protected URL proxyHttpURL(String scheme,
                           String serverName,
                           int serverPort,
                           String uri)
                    throws MalformedURLException
Description copied from class: ProxyServlet
Resolve requested URL to the Proxied URL

Overrides:
proxyHttpURL in class ProxyServlet
Parameters:
scheme - The scheme of the received request.
serverName - The server encoded in the received request(which may be from an absolute URL in the request line).
serverPort - The server port of the received request (which may be from an absolute URL in the request line).
uri - The URI of the received request.
Returns:
The URL to which the request should be proxied.
Throws:
MalformedURLException


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.