public class HttpResponse extends Object
| Constructor and Description |
|---|
HttpResponse(HttpExchange exchange,
javax.servlet.http.HttpServletResponse coreResponse) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(String name,
String value,
int maxAge)
Adds a cookie for request context path.
|
void |
addCookie(String name,
String value,
int maxAge,
String path)
Adds a cookie.
|
javax.servlet.http.HttpServletResponse |
getCoreResponse() |
HttpExchange |
getExchange() |
void |
removeCookie(String name)
Removes a cookie for request context path.
|
void |
removeCookie(String name,
String path)
Removes a cookie.
|
void |
writeObject(HttpObjectSerializer serializer,
Object obj)
Writes an object into response
|
void |
writeObject(Object obj)
Writes an object into response using exchange default serializer.
|
public HttpResponse(HttpExchange exchange, javax.servlet.http.HttpServletResponse coreResponse)
public javax.servlet.http.HttpServletResponse getCoreResponse()
public HttpExchange getExchange()
public void addCookie(String name, String value, int maxAge, String path)
name - cookie namevalue - cookie valuemaxAge - an integer specifying the maximum age of the cookie in seconds; if negative, means the cookie is not stored; if zero, deletes the cookiepath - cookie path (usually HttpServletRequest.getContextPath())public final void addCookie(String name, String value, int maxAge)
name - cookie namevalue - cookie valuemaxAge - an integer specifying the maximum age of the cookie in seconds; if negative, means the cookie is not stored; if zero, deletes the cookiepublic void removeCookie(String name, String path)
name - name of the cookie to be removedpath - cookie path ((usually HttpServletRequest.getContextPath())public final void removeCookie(String name)
name - name of the cookie to be removedpublic void writeObject(HttpObjectSerializer serializer, Object obj) throws IOException
serializer - object serializer.obj - object to be writtenIOException - if an error happened during writing operationpublic final void writeObject(Object obj) throws IOException
obj - object to be writtenIOException - if an error happened during writing operationCopyright © 2016 Agapsys Tecnologia Ltda-ME. All rights reserved.