|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.web.rendering.Response
public class Response
A CCC response. TODO: Never cache secure resources (i.e. with an ACL). TODO: The Response#write() method IS NOT THE PLACE for thumbnail code. TODO: _headers should be a set not a map.
Constructor Summary | |
---|---|
Response(Body body)
Constructor. |
Method Summary | |
---|---|
void |
dontCache()
Configure headers to prevent caching of this response. |
Body |
getBody()
Accessor. |
java.util.Map<java.lang.String,Header> |
getHeaders()
Accessor. |
void |
setCharSet(java.lang.String charset)
Mutator. |
void |
setDescription(java.lang.String description)
Mutator. |
void |
setDisposition(java.lang.String disposition)
Mutator. |
void |
setEtag(java.lang.String tag,
boolean weak)
Set an ETag for the response. |
void |
setExpiry(Duration expiry)
Mutator. |
void |
setLastModified(java.util.Date dateModified)
Set a 'last modified' date for the response. |
void |
setLength(long length)
Mutator. |
void |
setMimeType(MimeType mType)
Mutator. |
void |
write(javax.servlet.http.HttpServletResponse httpResponse,
Context context,
TextProcessor processor)
Write the response using the servlet API. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Response(Body body)
body
- The response's body.Method Detail |
---|
public void setDescription(java.lang.String description)
description
- The new description.public void setLength(long length)
length
- The size of the response's body, in bytes.public void setCharSet(java.lang.String charset)
charset
- The new character set.public void setMimeType(MimeType mType)
mType
- The mime type for the response.public void setExpiry(Duration expiry)
expiry
- The response's expiry time, as a Duration.public void setDisposition(java.lang.String disposition)
disposition
- The new disposition for this response.public Body getBody()
public java.util.Map<java.lang.String,Header> getHeaders()
public void write(javax.servlet.http.HttpServletResponse httpResponse, Context context, TextProcessor processor) throws java.io.IOException
httpResponse
- The servlet response.processor
- The text processor used to render the body.context
- The context for the response.
java.io.IOException
- Thrown if writing fails.public void setEtag(java.lang.String tag, boolean weak)
The specified tag will be quoted before it is sent.
tag
- The entity tag to set.weak
- True if this is a weak entity tag, false otherwise.public void setLastModified(java.util.Date dateModified)
dateModified
- The last time the response body was modified.public void dontCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |