org.tuckey.web.filters.urlrewrite
Class RequestProxy

java.lang.Object
  extended by org.tuckey.web.filters.urlrewrite.RequestProxy

public class RequestProxy
extends java.lang.Object

This class is responsible for a proxy http request. It takes the incoming request and then it creates a new request to the target address and copies the response of that proxy request to the response of the original request.

This class uses the commons-httpclient classes from Apache.

User: Joachim Ansorg, Date: 19.06.2008 Time: 16:02:54


Constructor Summary
RequestProxy()
           
 
Method Summary
static void copyStream(java.io.InputStream in, java.io.OutputStream out)
           
static void execute(java.lang.String target, javax.servlet.http.HttpServletRequest hsRequest, javax.servlet.http.HttpServletResponse hsResponse)
          This method performs the proxying of the request to the target address.
static org.apache.commons.httpclient.ProxyHost getUseProxyServer(java.lang.String useProxyServer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestProxy

public RequestProxy()
Method Detail

execute

public static void execute(java.lang.String target,
                           javax.servlet.http.HttpServletRequest hsRequest,
                           javax.servlet.http.HttpServletResponse hsResponse)
                    throws java.io.IOException
This method performs the proxying of the request to the target address.

Parameters:
target - The target address. Has to be a fully qualified address. The request is send as-is to this address.
hsRequest - The request data which should be send to the
hsResponse - The response data which will contain the data returned by the proxied request to target.
Throws:
java.io.IOException - Passed on from the connection logic.

copyStream

public static void copyStream(java.io.InputStream in,
                              java.io.OutputStream out)
                       throws java.io.IOException
Throws:
java.io.IOException

getUseProxyServer

public static org.apache.commons.httpclient.ProxyHost getUseProxyServer(java.lang.String useProxyServer)