|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.ServletResponseWrapper javax.servlet.http.HttpServletResponseWrapper org.dlese.dpc.webapps.servlets.filters.CharArrayWrapper
public class CharArrayWrapper
A response wrapper that takes the servlet's or JSP's response and saves it into a char[] for use in Filters. The array can then be acted upon using a Filter to do post-processing on the respose content prior to it being sent out. See More Servlets and JavaServer Pages, chapter 9.
Field Summary |
---|
Constructor Summary | |
---|---|
CharArrayWrapper(HttpServletResponse response)
Constructor for the CharArrayWrapper object |
Method Summary | |
---|---|
int |
getContentLength()
Gets the contentLength attribute of the GenericResponseWrapper object |
String |
getContentType()
Gets the contentType attribute of the GenericResponseWrapper object |
String |
getErrorMsg()
Gets the errorMsg attribute of the CharArrayWrapper object |
int |
getStatus()
Gets the status attribute of the CharArrayWrapper object |
PrintWriter |
getWriter()
Replace the normal writer with a writer that ouputs our char[]. |
void |
sendError(int sc)
DESCRIPTION |
void |
sendError(int sc,
String msg)
DESCRIPTION |
void |
setContentLength(int length)
Sets the contentLength attribute of the GenericResponseWrapper object |
void |
setContentType(String type)
Sets the contentType attribute of the GenericResponseWrapper object |
void |
setStatus(int sc)
Sets the status attribute of the CharArrayWrapper object |
char[] |
toCharArray()
Convert to char[]. |
String |
toString()
Convert to String. |
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus |
Methods inherited from class javax.servlet.ServletResponseWrapper |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, getOutputStream, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setLocale, setResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletResponse |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, getOutputStream, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setLocale |
Constructor Detail |
---|
public CharArrayWrapper(HttpServletResponse response)
response
- The HttpServletResponse.Method Detail |
---|
public PrintWriter getWriter()
getWriter
in interface ServletResponse
getWriter
in class ServletResponseWrapper
public String toString()
toString
in class Object
public char[] toCharArray()
public void sendError(int sc) throws IOException
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
sc
- DESCRIPTION
IOException
- DESCRIPTIONpublic void sendError(int sc, String msg) throws IOException
sendError
in interface HttpServletResponse
sendError
in class HttpServletResponseWrapper
sc
- DESCRIPTIONmsg
- DESCRIPTION
IOException
- DESCRIPTIONpublic void setStatus(int sc)
setStatus
in interface HttpServletResponse
setStatus
in class HttpServletResponseWrapper
sc
- The new status valuepublic int getStatus()
public String getErrorMsg()
public void setContentLength(int length)
setContentLength
in interface ServletResponse
setContentLength
in class ServletResponseWrapper
length
- The new contentLength valuepublic int getContentLength()
public void setContentType(String type)
setContentType
in interface ServletResponse
setContentType
in class ServletResponseWrapper
type
- The new contentType valuepublic String getContentType()
getContentType
in interface ServletResponse
getContentType
in class ServletResponseWrapper
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |