|
|||||||||
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
The HTTP response.
Field Summary |
---|
Constructor Summary | |
---|---|
Http.Response()
|
Method Summary | |
---|---|
java.lang.Iterable<Http.Cookie> |
cookies()
|
void |
discardCookie(java.lang.String name)
Discard a cookie on the default path ("/") with no domain and that's not secure |
void |
discardCookie(java.lang.String name,
java.lang.String path)
Discard a cookie on the give path with no domain and not that's secure |
void |
discardCookie(java.lang.String name,
java.lang.String path,
java.lang.String domain)
Discard a cookie on the given path and domain that's not secure |
void |
discardCookie(java.lang.String name,
java.lang.String path,
java.lang.String domain,
boolean secure)
Discard a cookie in this result |
void |
discardCookies(java.lang.String... names)
Deprecated. Use the discardCookie methods instead |
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Gets the current response headers. |
void |
setContentType(java.lang.String contentType)
Sets the content-type of the response. |
void |
setCookie(java.lang.String name,
java.lang.String value)
Set a new transient cookie with path “/” For example: |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge)
Set a new cookie with path “/” |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge,
java.lang.String path)
Set a new cookie |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge,
java.lang.String path,
java.lang.String domain)
Set a new cookie |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.Integer maxAge,
java.lang.String path,
java.lang.String domain,
boolean secure,
boolean httpOnly)
Set a new cookie |
void |
setHeader(java.lang.String name,
java.lang.String value)
Adds a new header to the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Http.Response()
Method Detail |
---|
public void setHeader(java.lang.String name, java.lang.String value)
name
- The name of the header. Must not be null.value
- The value of the header. Must not be null.public java.util.Map<java.lang.String,java.lang.String> getHeaders()
public void setContentType(java.lang.String contentType)
contentType
- The content type. Must not be null.public void setCookie(java.lang.String name, java.lang.String value)
response().setCookie("theme", "blue");
name
- Cookie name. Must not be null.value
- Cookie value.public void setCookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge)
name
- Cookie name. Must not be null.value
- Cookie value.maxAge
- Cookie duration (null for a transient cookie and 0 or less for a cookie that expires now).public void setCookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge, java.lang.String path)
name
- Cookie name. Must not be null.value
- Cookie valuemaxAge
- Cookie duration (null for a transient cookie and 0 or less for a cookie that expires now)path
- Cookie pathpublic void setCookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge, java.lang.String path, java.lang.String domain)
name
- Cookie name. Must not be null.value
- Cookie valuemaxAge
- Cookie duration (null for a transient cookie and 0 or less for a cookie that expires now)path
- Cookie pathdomain
- Cookie domainpublic void setCookie(java.lang.String name, java.lang.String value, java.lang.Integer maxAge, java.lang.String path, java.lang.String domain, boolean secure, boolean httpOnly)
name
- Cookie name. Must not be null.value
- Cookie valuemaxAge
- Cookie duration (null for a transient cookie and 0 or less for a cookie that expires now)path
- Cookie pathdomain
- Cookie domainsecure
- Whether the cookie is secured (for HTTPS requests)httpOnly
- Whether the cookie is HTTP only (i.e. not accessible from client-side JavaScript code)@Deprecated public void discardCookies(java.lang.String... names)
response().discardCookies("theme");This only discards cookies on the default path ("/") with no domain and that didn't have secure set. To discard other cookies, use the discardCookie method.
names
- Names of the cookies to discard. Must not be null.public void discardCookie(java.lang.String name)
name
- The name of the cookie to discard. Must not be null.public void discardCookie(java.lang.String name, java.lang.String path)
name
- The name of the cookie to discard. Must not be null.path
- The path of the cookie te discard, may be nullpublic void discardCookie(java.lang.String name, java.lang.String path, java.lang.String domain)
name
- The name of the cookie to discard. Must not be null.path
- The path of the cookie te discard, may be nulldomain
- The domain of the cookie to discard, may be nullpublic void discardCookie(java.lang.String name, java.lang.String path, java.lang.String domain, boolean secure)
name
- The name of the cookie to discard. Must not be null.path
- The path of the cookie te discard, may be nulldomain
- The domain of the cookie to discard, may be nullsecure
- Whether the cookie to discard is securepublic java.lang.Iterable<Http.Cookie> cookies()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |