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
-
Constructor Summary
ConstructorDescriptionServletSubResponseWrapper
(ServletResponse resp, TempFileContext tempFileContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
Gets the captured output.boolean
void
reset()
void
void
setBufferSize
(int size) void
setCharacterEncoding
(String charset) void
setContentLength
(int len) void
setContentLengthLong
(long len) void
setContentType
(String type) void
Methods 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:
setCharacterEncoding
in interfaceServletResponse
- Overrides:
setCharacterEncoding
in classServletResponseWrapper
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfaceServletResponse
- Overrides:
getCharacterEncoding
in classServletResponseWrapper
-
getOutputStream
- Specified by:
getOutputStream
in interfaceServletResponse
- Overrides:
getOutputStream
in classServletResponseWrapper
- Throws:
IOException
-
getWriter
- Specified by:
getWriter
in interfaceServletResponse
- Overrides:
getWriter
in classServletResponseWrapper
- Throws:
IOException
-
getCapturedOut
Description copied from interface:IServletSubResponse
Gets the captured output. This closes the associated capturing writer. Any subsequent writes will create a new buffer.- Specified by:
getCapturedOut
in interfaceIServletSubResponse
- Throws:
IOException
-
setContentLength
public void setContentLength(int len) - Specified by:
setContentLength
in interfaceServletResponse
- Overrides:
setContentLength
in classServletResponseWrapper
-
setContentLengthLong
public void setContentLengthLong(long len) - Specified by:
setContentLengthLong
in interfaceServletResponse
- Overrides:
setContentLengthLong
in classServletResponseWrapper
-
setContentType
- Specified by:
setContentType
in interfaceServletResponse
- Overrides:
setContentType
in classServletResponseWrapper
-
getContentType
- Specified by:
getContentType
in interfaceServletResponse
- Overrides:
getContentType
in classServletResponseWrapper
-
setBufferSize
public void setBufferSize(int size) - Specified by:
setBufferSize
in interfaceServletResponse
- Overrides:
setBufferSize
in classServletResponseWrapper
-
getBufferSize
public int getBufferSize()- Specified by:
getBufferSize
in interfaceServletResponse
- Overrides:
getBufferSize
in classServletResponseWrapper
-
flushBuffer
- Specified by:
flushBuffer
in interfaceServletResponse
- Overrides:
flushBuffer
in classServletResponseWrapper
- Throws:
IOException
-
isCommitted
public boolean isCommitted()- Specified by:
isCommitted
in interfaceServletResponse
- Overrides:
isCommitted
in classServletResponseWrapper
-
reset
public void reset()- Specified by:
reset
in interfaceServletResponse
- Overrides:
reset
in classServletResponseWrapper
-
resetBuffer
public void resetBuffer()- Specified by:
resetBuffer
in interfaceServletResponse
- Overrides:
resetBuffer
in classServletResponseWrapper
-
setLocale
- Specified by:
setLocale
in interfaceServletResponse
- Overrides:
setLocale
in classServletResponseWrapper
-
getLocale
- Specified by:
getLocale
in interfaceServletResponse
- Overrides:
getLocale
in classServletResponseWrapper
-