@ThreadRestricted(value="Call constructor") public final class Responding extends Object implements Requesting, ResponseConfiguration
| Constructor and Description |
|---|
Responding(WAP _wap,
HttpServletRequest _request,
HttpServletResponse _response)
Constructs a Responding.
|
| Modifier and Type | Method and Description |
|---|---|
void |
headMustRevalidate()
Instructs the client to validate the response for every request, such that it
never uses a stale response without first asking the user's permission.
|
void |
headNoCache()
Makes the response non-cacheable by the client.
|
Writer |
outBuf()
The writer for the response.
|
com.google.gson.stream.JsonWriter |
outJSON()
A JSON writer based on outBuf.
|
String |
outJSONIndent()
The indentation unit for the JSON writer (e.g. 3 or 4 spaces), or an empty string
"" if no indentation is required.
|
HttpServletRequest |
request()
The HTTP request from the client.
|
(package private) void |
respond()
Responds to all calls.
|
HttpServletResponse |
response()
The HTTP response to the client.
|
WAP |
wap()
The servlet handling the request.
|
boolean |
wPretty()
Whether it was requested that the response be human readable.
|
Responding(WAP _wap, HttpServletRequest _request, HttpServletResponse _response) throws HTTPRequestException
HTTPRequestExceptionwap(),
request(),
response()@Warning(value="flush outJSON") public Writer outBuf()
public com.google.gson.stream.JsonWriter outJSON()
public String outJSONIndent()
void respond() throws IOException
IOExceptionpublic HttpServletResponse response()
public HttpServletRequest request()
Requestingrequest in interface Requestingpublic WAP wap()
Requestingwap in interface Requestingpublic boolean wPretty()
RequestingwPretty in interface Requestingpublic void headMustRevalidate()
ResponseConfigurationheadMustRevalidate in interface ResponseConfigurationpublic void headNoCache()
ResponseConfigurationno-cache.
These nevertheless fail with Chrome 18. Consider adding a nonce to the client request as a fallback.
headNoCache in interface ResponseConfiguration