public class BufferedWebContextImpl extends AbstractWebContextWrapper implements BufferedWebContext
REQUEST_ATTRIBUTE_FROM_WEBCONTEXT
Constructor and Description |
---|
BufferedWebContextImpl(WebContext wrappedContext) |
Modifier and Type | Method and Description |
---|---|
BufferedResponseImpl |
getBufferedResponse()
取得
BufferedRunDataResponse 实例。 |
boolean |
isBuffering()
设置是否将所有信息保存在内存中。
|
ByteArray |
peekByteBuffer()
返回最上层的ByteArray
|
String |
peekCharBuffer()
返回最上层的buffer
|
ByteArray |
popByteBuffer()
弹出最近的buffer,如果堆栈中只有一个buffer,则弹出后再创建一个新的。
|
String |
popCharBuffer()
弹出最近的buffer,如果堆栈中只有一个buffer,则弹出后再创建一个新的。
|
void |
pushBuffer()
创建新的buffer,保存老的buffer。
|
void |
setBuffering(boolean buffering)
设置buffer模式,如果设置成
true ,表示将所有信息保存在内存中,否则直接输出到原始response中。 |
exist, existFromWrapperContext, get, getFromWrapperContext, getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, getWrappedWebContext, init, isRequestFinished, putSubWebContext, setObject, setRequest, setResponse, setServletContext
clear, clearSubContext, contain, containNodeMap, createSubContext, existNodeMap, findNodeMap, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalContext, getTotalItemMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParent
get, put, putAll, remove, setItemMap, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, isRequestFinished, setObject, setRequest, setResponse, setServletContext
clearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParent
public BufferedWebContextImpl(WebContext wrappedContext)
public boolean isBuffering()
isBuffering
in interface BufferedWebContext
true
public void setBuffering(boolean buffering)
true
,表示将所有信息保存在内存中,否则直接输出到原始response中。
此方法必须在getOutputStream
和getWriter
方法之前执行,否则将抛出
IllegalStateException
。
setBuffering
in interface BufferedWebContext
buffering
- 是否buffer内容IllegalStateException
- getOutputStream
或
getWriter
方法已经被执行public void pushBuffer()
pushBuffer
in interface BufferedWebContext
IllegalStateException
- 如果不在buffer模式,或getWriter
及
getOutputStream
方法从未被调用public ByteArray popByteBuffer()
popByteBuffer
in interface BufferedWebContext
IllegalStateException
- 如果不在buffer模式,或getWriter
方法曾被调用,或 getOutputStream
方法从未被调用public String popCharBuffer()
popCharBuffer
in interface BufferedWebContext
IllegalStateException
- 如果不在buffer模式,或getOutputStream
方法曾被调用,或getWriter
方法从未被调用public BufferedResponseImpl getBufferedResponse()
BufferedRunDataResponse
实例。BufferedRunDataResponse
实例public ByteArray peekByteBuffer()
BufferedWebContext
peekByteBuffer
in interface BufferedWebContext
public String peekCharBuffer()
BufferedWebContext
peekCharBuffer
in interface BufferedWebContext
Copyright © 2006–2018 TinyGroup. All rights reserved.