|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.mvc.Http.Response
public static class Http.Response
An HTTP response
Field Summary | |
---|---|
java.lang.String |
contentType
Response content type |
java.util.Map<java.lang.String,Http.Cookie> |
cookies
Response cookies |
static java.lang.ThreadLocal<Http.Response> |
current
Bind to thread |
java.io.File |
direct
Send this file directly |
java.util.Map<java.lang.String,Http.Header> |
headers
Response headers |
java.io.ByteArrayOutputStream |
out
Response body stream |
java.lang.Integer |
status
Response status code |
Constructor Summary | |
---|---|
Http.Response()
|
Method Summary | |
---|---|
void |
cacheFor(java.lang.String duration)
Add a cache-control header |
void |
cacheFor(java.lang.String etag,
java.lang.String duration,
long lastModified)
Add cache-control headers |
static Http.Response |
current()
Retrieve the current response |
java.lang.String |
getHeader(java.lang.String name)
Get a response header |
void |
print(java.lang.Object o)
|
void |
reset()
|
void |
setCookie(java.lang.String name,
java.lang.String value)
Set a new cookie |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge)
|
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.String duration)
Set a new cookie that will expire in (current) + duration |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.String domain,
java.lang.String path,
java.lang.Integer maxAge)
|
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.String domain,
java.lang.String path,
java.lang.String duration)
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Set a response header |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.Integer status
public java.lang.String contentType
public java.util.Map<java.lang.String,Http.Header> headers
public java.util.Map<java.lang.String,Http.Cookie> cookies
public java.io.ByteArrayOutputStream out
public java.io.File direct
public static java.lang.ThreadLocal<Http.Response> current
Constructor Detail |
---|
public Http.Response()
Method Detail |
---|
public static Http.Response current()
public java.lang.String getHeader(java.lang.String name)
name
- Header name
public void setHeader(java.lang.String name, java.lang.String value)
name
- Header namevalue
- Header valuepublic void setCookie(java.lang.String name, java.lang.String value)
name
- Cookie namevalue
- Cookie valuepublic void setCookie(java.lang.String name, java.lang.String value, java.lang.String duration)
name
- value
- duration
- Ex: 3dpublic void setCookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge)
public void setCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, java.lang.String duration)
public void setCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, java.lang.Integer maxAge)
public void cacheFor(java.lang.String duration)
duration
- Ex: 3hpublic void cacheFor(java.lang.String etag, java.lang.String duration, long lastModified)
duration
- Ex: 3hpublic void print(java.lang.Object o)
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |