ResponseAdapterpublic class HttpServletResponseAdapter extends AbstractResponseAdapter
adaptee| Constructor | Description |
|---|---|
HttpServletResponseAdapter(javax.servlet.http.HttpServletResponse response,
Activity activity) |
Instantiates a new HttpServletResponseAdapter.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
flush() |
|
java.lang.String |
getContentType() |
Returns the content type used for the MIME body sent in this response.
|
java.lang.String |
getEncoding() |
Returns the name of the character encoding (MIME charset) used for the body
sent in this response.
|
java.io.OutputStream |
getOutputStream() |
Returns a
OutputStream suitable for writing binary data in the response. |
java.io.Writer |
getWriter() |
Returns a
Writer object that can send character text to the client. |
java.lang.String |
redirect(RedirectResponseRule redirectResponseRule) |
Redirects a client to a new URL.
|
void |
redirect(java.lang.String target) |
Redirects a client to a new URL.
|
void |
setContentType(java.lang.String contentType) |
Sets the content type of the response being sent to the client,
if the response has not been committed yet.
|
void |
setEncoding(java.lang.String encoding) |
Sets the character encoding of the response being sent to the client.
|
addHeader, containsHeader, getHeader, getHeaderNames, getHeaders, getHeaders, getStatus, setHeader, setStatus, touchHeadersgetAdapteeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddHeader, containsHeader, getHeader, getHeaderNames, getHeaders, getHeaders, getStatus, setHeader, setStatus, touchHeaderspublic HttpServletResponseAdapter(javax.servlet.http.HttpServletResponse response,
Activity activity)
response - the HTTP responseactivity - the activitypublic java.lang.String getEncoding()
ResponseAdapterString specifying the name of the character encoding,
for example, UTF-8public void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
ResponseAdapterencoding - a String specifying only the character set
defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)java.io.UnsupportedEncodingException - if character encoding is not supportedpublic java.lang.String getContentType()
ResponseAdapterString specifying the content type,
for example, text/html, or nullpublic void setContentType(java.lang.String contentType)
ResponseAdaptercontentType - a String specifying the MIME type of the contentpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
ResponseAdapterOutputStream suitable for writing binary data in the response.OutputStream for writing binary datajava.io.IOException - if an input or output exception occurspublic java.io.Writer getWriter()
throws java.io.IOException
ResponseAdapterWriter object that can send character text to the client.Writer object that can return character data to the clientjava.io.IOException - if an input or output exception occurspublic void redirect(java.lang.String target)
throws java.io.IOException
ResponseAdaptertarget - the redirect targetjava.io.IOException - if an input or output exception occurspublic java.lang.String redirect(RedirectResponseRule redirectResponseRule) throws java.io.IOException
ResponseAdapterredirectResponseRule - the redirect response rulejava.io.IOException - if an input or output exception occurspublic void flush()
Copyright © 2008–2017 The Aspectran Project. All rights reserved.