public abstract class BaseResponseContext extends Object implements WebContext
Modifier and Type | Field and Description |
---|---|
protected String |
responseContent |
protected String |
responseContentType |
protected Collection<Cookie> |
responseCookies |
protected String |
responseEncoding |
protected Map<String,String> |
responseHeaders |
protected String |
responseLocation |
protected int |
responseStatus |
Constructor and Description |
---|
BaseResponseContext() |
Modifier and Type | Method and Description |
---|---|
void |
addResponseCookie(Cookie cookie)
Adds cookies to the response
|
String |
getResponseContent() |
String |
getResponseContentType() |
String |
getResponseEncoding() |
Map<String,String> |
getResponseHeaders() |
String |
getResponseLocation() |
int |
getResponseStatus() |
void |
setResponseCharacterEncoding(String encoding)
Sets the response encoding type.
|
void |
setResponseContentType(String content)
Sets the response content type.
|
void |
setResponseHeader(String name,
String value)
Add a header to the response.
|
void |
setResponseStatus(int code)
Set the response status.
|
void |
writeResponseContent(String content)
Write some content in the response.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFullRequestURL, getRemoteAddr, getRequestAttribute, getRequestCookies, getRequestHeader, getRequestMethod, getRequestParameter, getRequestParameters, getScheme, getServerName, getServerPort, getSessionAttribute, getSessionIdentifier, setRequestAttribute, setSessionAttribute
protected String responseContent
protected int responseStatus
protected String responseLocation
protected String responseContentType
protected String responseEncoding
protected final Collection<Cookie> responseCookies
public void writeResponseContent(String content)
WebContext
writeResponseContent
in interface WebContext
content
- content to write in responsepublic void setResponseStatus(int code)
WebContext
setResponseStatus
in interface WebContext
code
- status code to set for the responsepublic void setResponseHeader(String name, String value)
WebContext
setResponseHeader
in interface WebContext
name
- name of the headervalue
- value of the headerpublic String getResponseContent()
public int getResponseStatus()
public String getResponseLocation()
public void setResponseCharacterEncoding(String encoding)
WebContext
setResponseCharacterEncoding
in interface WebContext
encoding
- the character encodingpublic void setResponseContentType(String content)
WebContext
setResponseContentType
in interface WebContext
content
- the content typepublic String getResponseContentType()
public String getResponseEncoding()
public void addResponseCookie(Cookie cookie)
WebContext
addResponseCookie
in interface WebContext
cookie
- a cookie to add to the responseCopyright © 2015. All Rights Reserved.