org.springframework.extensions.webscripts.servlet
Class HTTPProxy

java.lang.Object
  extended by org.springframework.extensions.webscripts.servlet.HTTPProxy

public class HTTPProxy
extends Object

Simple server-side HTTP Request / Response

Author:
davidc

Field Summary
protected  javax.servlet.http.HttpServletResponse response
           
protected  URL url
           
 
Constructor Summary
HTTPProxy(String requestUrl, javax.servlet.http.HttpServletResponse response)
          Construct
 
Method Summary
protected  void initialiseResponse(URLConnection urlConnection)
          Initialise response
 void service()
          Perform request
protected  void writeResponse(InputStream input, OutputStream output)
          Write response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected URL url

response

protected javax.servlet.http.HttpServletResponse response
Constructor Detail

HTTPProxy

public HTTPProxy(String requestUrl,
                 javax.servlet.http.HttpServletResponse response)
          throws MalformedURLException
Construct

Parameters:
requestUrl - url to request
response - response to write request back to
Throws:
MalformedURLException
Method Detail

service

public void service()
             throws IOException
Perform request

Throws:
IOException

initialiseResponse

protected void initialiseResponse(URLConnection urlConnection)
Initialise response

Parameters:
urlConnection - url connection

writeResponse

protected void writeResponse(InputStream input,
                             OutputStream output)
                      throws IOException
Write response

Parameters:
input - input stream of request
output - output stream of response
Throws:
IOException


Copyright © 2009 SpringSource, Inc. All Rights Reserved.