Package org.apache.wicket.protocol.http
Class BufferedWebResponse
- java.lang.Object
-
- org.apache.wicket.request.Response
-
- org.apache.wicket.request.http.WebResponse
-
- org.apache.wicket.protocol.http.BufferedWebResponse
-
- All Implemented Interfaces:
IMetaDataBufferingWebResponse
public class BufferedWebResponse extends org.apache.wicket.request.http.WebResponse implements IMetaDataBufferingWebResponse
Subclass ofWebResponse
that buffers the actions and performs those on another response.- Author:
- Matej Knopp
- See Also:
writeTo(WebResponse)
-
-
Constructor Summary
Constructors Constructor Description BufferedWebResponse(org.apache.wicket.request.http.WebResponse originalResponse)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCookie(javax.servlet.http.Cookie cookie)
void
addHeader(String name, String value)
void
clearCookie(javax.servlet.http.Cookie cookie)
void
disableCaching()
String
encodeRedirectURL(CharSequence url)
String
encodeURL(CharSequence url)
void
flush()
Object
getContainerResponse()
CharSequence
getText()
Returns the text already written to this response.boolean
isHeaderSupported()
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, Instant date)
void
setHeader(String name, String value)
void
setStatus(int sc)
void
setText(CharSequence text)
Replaces the text in this responseString
toString()
void
write(byte[] array)
void
write(byte[] array, int offset, int length)
void
write(CharSequence sequence)
void
writeMetaData(org.apache.wicket.request.http.WebResponse response)
transfer cookie operations (add, clear) to given web responsevoid
writeTo(org.apache.wicket.request.http.WebResponse response)
Writes the content of the buffer to the specified response.
-
-
-
Constructor Detail
-
BufferedWebResponse
public BufferedWebResponse(org.apache.wicket.request.http.WebResponse originalResponse)
Construct.- Parameters:
originalResponse
-
-
-
Method Detail
-
writeMetaData
public void writeMetaData(org.apache.wicket.request.http.WebResponse response)
transfer cookie operations (add, clear) to given web response- Specified by:
writeMetaData
in interfaceIMetaDataBufferingWebResponse
- Parameters:
response
- web response that should receive the current cookie operation
-
encodeURL
public String encodeURL(CharSequence url)
- Specified by:
encodeURL
in classorg.apache.wicket.request.Response
-
encodeRedirectURL
public String encodeRedirectURL(CharSequence url)
- Specified by:
encodeRedirectURL
in classorg.apache.wicket.request.http.WebResponse
-
reset
public void reset()
- Overrides:
reset
in classorg.apache.wicket.request.Response
-
addCookie
public void addCookie(javax.servlet.http.Cookie cookie)
- Specified by:
addCookie
in classorg.apache.wicket.request.http.WebResponse
-
clearCookie
public void clearCookie(javax.servlet.http.Cookie cookie)
- Specified by:
clearCookie
in classorg.apache.wicket.request.http.WebResponse
-
setContentLength
public void setContentLength(long length)
- Specified by:
setContentLength
in classorg.apache.wicket.request.http.WebResponse
-
setContentType
public void setContentType(String mimeType)
- Specified by:
setContentType
in classorg.apache.wicket.request.http.WebResponse
-
setDateHeader
public void setDateHeader(String name, Instant date)
- Specified by:
setDateHeader
in classorg.apache.wicket.request.http.WebResponse
-
isHeaderSupported
public boolean isHeaderSupported()
- Specified by:
isHeaderSupported
in classorg.apache.wicket.request.http.WebResponse
-
setHeader
public void setHeader(String name, String value)
- Specified by:
setHeader
in classorg.apache.wicket.request.http.WebResponse
-
addHeader
public void addHeader(String name, String value)
- Specified by:
addHeader
in classorg.apache.wicket.request.http.WebResponse
-
disableCaching
public void disableCaching()
- Overrides:
disableCaching
in classorg.apache.wicket.request.http.WebResponse
-
write
public void write(CharSequence sequence)
- Specified by:
write
in classorg.apache.wicket.request.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 classorg.apache.wicket.request.Response
-
write
public void write(byte[] array, int offset, int length)
- Specified by:
write
in classorg.apache.wicket.request.Response
-
sendRedirect
public void sendRedirect(String url)
- Specified by:
sendRedirect
in classorg.apache.wicket.request.http.WebResponse
-
setStatus
public void setStatus(int sc)
- Specified by:
setStatus
in classorg.apache.wicket.request.http.WebResponse
-
sendError
public void sendError(int sc, String msg)
- Specified by:
sendError
in classorg.apache.wicket.request.http.WebResponse
-
writeTo
public void writeTo(org.apache.wicket.request.http.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 classorg.apache.wicket.request.http.WebResponse
-
flush
public void flush()
- Specified by:
flush
in classorg.apache.wicket.request.http.WebResponse
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
getContainerResponse
public Object getContainerResponse()
- Specified by:
getContainerResponse
in classorg.apache.wicket.request.Response
-
-