org.apache.wicket.protocol.http
Class BufferedWebResponse

java.lang.Object
  extended by org.apache.wicket.request.Response
      extended by org.apache.wicket.request.http.WebResponse
          extended by org.apache.wicket.protocol.http.BufferedWebResponse
All Implemented Interfaces:
IMetaDataBufferingWebResponse

public class BufferedWebResponse
extends WebResponse
implements IMetaDataBufferingWebResponse

Subclass of WebResponse that buffers the actions and performs those on another response.

Author:
Matej Knopp
See Also:
writeTo(WebResponse)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.http.WebResponse
WebResponse.CacheScope
 
Field Summary
 
Fields inherited from class org.apache.wicket.request.http.WebResponse
MAX_CACHE_DURATION
 
Constructor Summary
BufferedWebResponse(WebResponse originalResponse)
          Construct.
 
Method Summary
 void addCookie(javax.servlet.http.Cookie cookie)
           
 void addHeader(String name, String value)
           
 void clearCookie(javax.servlet.http.Cookie cookie)
           
 String encodeRedirectURL(CharSequence url)
           
 String encodeURL(CharSequence url)
           
 void flush()
           
 Object getContainerResponse()
           
 CharSequence getText()
          Returns the text already written to this response.
 boolean isRedirect()
           
 void reset()
           
 void sendError(int sc, String msg)
           
 void sendRedirect(String url)
           
 void setContentLength(long length)
           
 void setContentType(String mimeType)
           
 void setDateHeader(String name, Time date)
           
 void setHeader(String name, String value)
           
 void setStatus(int sc)
           
 void setText(CharSequence text)
          Replaces the text in this response
 String toString()
           
 void write(byte[] array)
           
 void write(byte[] array, int offset, int length)
           
 void write(CharSequence sequence)
           
 void writeMetaData(WebResponse response)
          transfer cookie operations (add, clear) to given web response
 void writeTo(WebResponse response)
          Writes the content of the buffer to the specified response.
 
Methods inherited from class org.apache.wicket.request.http.WebResponse
disableCaching, enableCaching, setAttachmentHeader, setInlineHeader, setLastModifiedTime
 
Methods inherited from class org.apache.wicket.request.Response
close, getOutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BufferedWebResponse

public BufferedWebResponse(WebResponse originalResponse)
Construct.

Parameters:
originalResponse -
Method Detail

writeMetaData

public void writeMetaData(WebResponse response)
transfer cookie operations (add, clear) to given web response

Specified by:
writeMetaData in interface IMetaDataBufferingWebResponse
Parameters:
response - web response that should receive the current cookie operation

encodeURL

public String encodeURL(CharSequence url)
Specified by:
encodeURL in class Response

encodeRedirectURL

public String encodeRedirectURL(CharSequence url)
Specified by:
encodeRedirectURL in class WebResponse

reset

public void reset()
Overrides:
reset in class Response

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Specified by:
addCookie in class WebResponse

clearCookie

public void clearCookie(javax.servlet.http.Cookie cookie)
Specified by:
clearCookie in class WebResponse

setContentLength

public void setContentLength(long length)
Specified by:
setContentLength in class WebResponse

setContentType

public void setContentType(String mimeType)
Specified by:
setContentType in class WebResponse

setDateHeader

public void setDateHeader(String name,
                          Time date)
Specified by:
setDateHeader in class WebResponse

setHeader

public void setHeader(String name,
                      String value)
Specified by:
setHeader in class WebResponse

addHeader

public void addHeader(String name,
                      String value)
Specified by:
addHeader in class WebResponse

write

public void write(CharSequence sequence)
Specified by:
write in class Response

getText

public CharSequence getText()
Returns the text already written to this response.

Returns:
text

setText

public void setText(CharSequence text)
Replaces the text in this response

Parameters:
text -

write

public void write(byte[] array)
Specified by:
write in class Response

write

public void write(byte[] array,
                  int offset,
                  int length)
Overrides:
write in class Response

sendRedirect

public void sendRedirect(String url)
Specified by:
sendRedirect in class WebResponse

setStatus

public void setStatus(int sc)
Specified by:
setStatus in class WebResponse

sendError

public void sendError(int sc,
                      String msg)
Specified by:
sendError in class WebResponse

writeTo

public void writeTo(WebResponse response)
Writes the content of the buffer to the specified response. Also sets the properties and and headers.

Parameters:
response -

isRedirect

public boolean isRedirect()
Specified by:
isRedirect in class WebResponse

flush

public void flush()
Specified by:
flush in class WebResponse

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getContainerResponse

public Object getContainerResponse()
Specified by:
getContainerResponse in class Response


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.