public abstract class OnCommittedResponseWrapper
extends HttpServletResponseWrapper
javax.servlet.http.HttpServletResponse
is committed.Constructor and Description |
---|
OnCommittedResponseWrapper(HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value) |
protected void |
disableOnResponseCommitted()
Invoke this method to disable invoking
onResponseCommitted() when the
javax.servlet.http.HttpServletResponse is committed. |
void |
flushBuffer()
Makes sure
onResponseCommitted() is invoked
before calling the superclass flushBuffer() |
ServletOutputStream |
getOutputStream()
Makes sure
onResponseCommitted() is invoked
before calling the calling getOutputStream().close() or
getOutputStream().flush() |
java.io.PrintWriter |
getWriter()
Makes sure
onResponseCommitted() is invoked
before calling the getWriter().close() or
getWriter().flush() |
protected boolean |
isDisableOnResponseCommitted()
Returns true if
onResponseCommitted() will be invoked when the response is
committed, else false. |
protected abstract void |
onResponseCommitted()
Implement the logic for handling the
javax.servlet.http.HttpServletResponse
being committed |
void |
sendError(int sc)
Makes sure
onResponseCommitted() is invoked
before calling the superclass sendError() |
void |
sendError(int sc,
java.lang.String msg)
Makes sure
onResponseCommitted() is invoked
before calling the superclass sendError() |
void |
sendRedirect(java.lang.String location)
Makes sure
onResponseCommitted() is invoked
before calling the superclass sendRedirect() |
void |
setContentLength(int len) |
public OnCommittedResponseWrapper(HttpServletResponse response)
response
- the response to be wrappedpublic void addHeader(java.lang.String name, java.lang.String value)
public void setContentLength(int len)
protected void disableOnResponseCommitted()
onResponseCommitted()
when the
javax.servlet.http.HttpServletResponse
is committed. This can be useful in
the event that Async Web Requests are made.protected boolean isDisableOnResponseCommitted()
onResponseCommitted()
will be invoked when the response is
committed, else false.onResponseCommitted()
is enabledprotected abstract void onResponseCommitted()
javax.servlet.http.HttpServletResponse
being committedpublic final void sendError(int sc) throws java.io.IOException
onResponseCommitted()
is invoked
before calling the superclass sendError()
java.io.IOException
public final void sendError(int sc, java.lang.String msg) throws java.io.IOException
onResponseCommitted()
is invoked
before calling the superclass sendError()
java.io.IOException
public final void sendRedirect(java.lang.String location) throws java.io.IOException
onResponseCommitted()
is invoked
before calling the superclass sendRedirect()
java.io.IOException
public ServletOutputStream getOutputStream() throws java.io.IOException
onResponseCommitted()
is invoked
before calling the calling getOutputStream().close()
or
getOutputStream().flush()
java.io.IOException
public java.io.PrintWriter getWriter() throws java.io.IOException
onResponseCommitted()
is invoked
before calling the getWriter().close()
or
getWriter().flush()
java.io.IOException
public void flushBuffer() throws java.io.IOException
onResponseCommitted()
is invoked
before calling the superclass flushBuffer()
java.io.IOException