Package com.aoapps.servlet.subrequest
Class ServletSubResponseWrapper
java.lang.Object
javax.servlet.ServletResponseWrapper
com.aoapps.servlet.subrequest.ServletSubResponseWrapper
- All Implemented Interfaces:
IServletSubResponse,ServletResponse
- Direct Known Subclasses:
HttpServletSubResponseWrapper
public class ServletSubResponseWrapper
extends ServletResponseWrapper
implements IServletSubResponse
Wraps a servlet response with the intent to operate as a concurrent sub response.
Any changes made to the response will only affect this response and will not be passed
along to the wrapped response.
The wrapped response may change state while this sub response is being processed. Any changes to the wrapped response will not affect this concurrent sub response.
This class is not thread safe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServletSubResponseWrapper(ServletResponse resp, TempFileContext tempFileContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidintGets the captured output.booleanvoidreset()voidvoidsetBufferSize(int size) voidsetCharacterEncoding(String charset) voidsetContentLength(int len) voidsetContentLengthLong(long len) voidsetContentType(String type) voidMethods inherited from class javax.servlet.ServletResponseWrapper
getResponse, isWrapperFor, isWrapperFor, setResponse
-
Field Details
-
committed
protected boolean committed
-
-
Constructor Details
-
ServletSubResponseWrapper
- Parameters:
tempFileContext- The temp file list for auto temp files.
-
-
Method Details
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceServletResponse- Overrides:
setCharacterEncodingin classServletResponseWrapper
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletResponse- Overrides:
getCharacterEncodingin classServletResponseWrapper
-
getOutputStream
- Specified by:
getOutputStreamin interfaceServletResponse- Overrides:
getOutputStreamin classServletResponseWrapper- Throws:
IOException
-
getWriter
- Specified by:
getWriterin interfaceServletResponse- Overrides:
getWriterin classServletResponseWrapper- Throws:
IOException
-
getCapturedOut
Description copied from interface:IServletSubResponseGets the captured output. This closes the associated capturing writer. Any subsequent writes will create a new buffer.- Specified by:
getCapturedOutin interfaceIServletSubResponse- Throws:
IOException
-
setContentLength
public void setContentLength(int len) - Specified by:
setContentLengthin interfaceServletResponse- Overrides:
setContentLengthin classServletResponseWrapper
-
setContentLengthLong
public void setContentLengthLong(long len) - Specified by:
setContentLengthLongin interfaceServletResponse- Overrides:
setContentLengthLongin classServletResponseWrapper
-
setContentType
- Specified by:
setContentTypein interfaceServletResponse- Overrides:
setContentTypein classServletResponseWrapper
-
getContentType
- Specified by:
getContentTypein interfaceServletResponse- Overrides:
getContentTypein classServletResponseWrapper
-
setBufferSize
public void setBufferSize(int size) - Specified by:
setBufferSizein interfaceServletResponse- Overrides:
setBufferSizein classServletResponseWrapper
-
getBufferSize
public int getBufferSize()- Specified by:
getBufferSizein interfaceServletResponse- Overrides:
getBufferSizein classServletResponseWrapper
-
flushBuffer
- Specified by:
flushBufferin interfaceServletResponse- Overrides:
flushBufferin classServletResponseWrapper- Throws:
IOException
-
isCommitted
public boolean isCommitted()- Specified by:
isCommittedin interfaceServletResponse- Overrides:
isCommittedin classServletResponseWrapper
-
reset
public void reset()- Specified by:
resetin interfaceServletResponse- Overrides:
resetin classServletResponseWrapper
-
resetBuffer
public void resetBuffer()- Specified by:
resetBufferin interfaceServletResponse- Overrides:
resetBufferin classServletResponseWrapper
-
setLocale
- Specified by:
setLocalein interfaceServletResponse- Overrides:
setLocalein classServletResponseWrapper
-
getLocale
- Specified by:
getLocalein interfaceServletResponse- Overrides:
getLocalein classServletResponseWrapper
-
