public final class Response extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
characterEncoding |
protected boolean |
charsetSet
Has the charset been explicitly set.
|
protected boolean |
commited
Committed flag.
|
protected String |
contentLanguage |
protected int |
contentLength |
protected String |
contentType
HTTP specific fields.
|
protected Exception |
errorException
Holds request error exception.
|
protected String |
errorURI
Request error URI.
|
protected MimeHeaders |
headers
Response headers.
|
ActionHook |
hook
Action hook.
|
protected String |
message
Status message.
|
protected OutputBuffer |
outputBuffer
Associated output buffer.
|
protected Request |
req |
protected int |
status
Status code.
|
| Constructor and Description |
|---|
Response() |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge() |
void |
action(ActionCode actionCode,
Object param) |
void |
addHeader(String name,
String value) |
boolean |
containsHeader(String name) |
void |
doWrite(ByteChunk chunk)
Write a chunk of bytes.
|
void |
finish() |
long |
getBytesWritten() |
String |
getCharacterEncoding() |
String |
getContentLanguage()
Return the content language.
|
int |
getContentLength() |
long |
getContentLengthLong() |
String |
getContentType() |
Exception |
getErrorException()
Get the Exception that occurred during request
processing.
|
String |
getErrorURI()
Get the request URI that caused the original error.
|
ActionHook |
getHook() |
Locale |
getLocale() |
String |
getMessage()
Get the status message.
|
MimeHeaders |
getMimeHeaders() |
Object |
getNote(int pos) |
NotesManagerImpl |
getNotesManager() |
OutputBuffer |
getOutputBuffer() |
Request |
getRequest() |
int |
getStatus() |
boolean |
isCommitted() |
boolean |
isExceptionPresent() |
void |
recycle() |
void |
removeSessionCookies()
Removes any Set-Cookie response headers whose value contains the
string JSESSIONID
|
void |
reset() |
void |
sendHeaders()
Signal that we're done with the headers, and body will follow.
|
void |
setBytesWritten(long bytesWritten) |
void |
setCharacterEncoding(String charset) |
void |
setCommitted(boolean v) |
void |
setContentLength(int contentLength) |
void |
setContentType(String type)
Sets the content type.
|
void |
setErrorException(Exception ex)
Set the error Exception that occurred during
request processing.
|
void |
setErrorURI(String uri)
Set request URI that caused an error during
request processing.
|
void |
setHeader(String name,
String value) |
void |
setHook(ActionHook hook) |
void |
setLocale(Locale locale)
Called explicitely by user to set the Content-Language and
the default encoding
|
void |
setMessage(String message)
Set the status message.
|
void |
setNote(int pos,
Object value) |
void |
setNotesManager(NotesManagerImpl notesManager) |
void |
setOutputBuffer(OutputBuffer outputBuffer) |
void |
setRequest(Request req) |
void |
setStatus(int status)
Set the response status
|
protected int status
protected String message
protected MimeHeaders headers
protected OutputBuffer outputBuffer
protected boolean commited
public ActionHook hook
protected String contentType
protected String contentLanguage
protected String characterEncoding
protected int contentLength
protected Exception errorException
protected boolean charsetSet
protected String errorURI
protected Request req
public Request getRequest()
public void setRequest(Request req)
public OutputBuffer getOutputBuffer()
public void setOutputBuffer(OutputBuffer outputBuffer)
public MimeHeaders getMimeHeaders()
public ActionHook getHook()
public void setHook(ActionHook hook)
public final void setNote(int pos,
Object value)
public final Object getNote(int pos)
public NotesManagerImpl getNotesManager()
public void setNotesManager(NotesManagerImpl notesManager)
public void action(ActionCode actionCode, Object param)
public int getStatus()
public void setStatus(int status)
public String getMessage()
public void setMessage(String message)
public boolean isCommitted()
public void setCommitted(boolean v)
public void setErrorException(Exception ex)
public Exception getErrorException()
public boolean isExceptionPresent()
public void setErrorURI(String uri)
public String getErrorURI()
public void reset()
throws IllegalStateException
IllegalStateExceptionpublic void finish()
throws IOException
IOExceptionpublic void acknowledge()
throws IOException
IOExceptionpublic boolean containsHeader(String name)
public void sendHeaders()
throws IOException
IOExceptionpublic Locale getLocale()
public void setLocale(Locale locale)
public String getContentLanguage()
public void setCharacterEncoding(String charset)
public String getCharacterEncoding()
public void setContentType(String type)
type - the content typepublic String getContentType()
public void setContentLength(int contentLength)
public int getContentLength()
public long getContentLengthLong()
public void doWrite(ByteChunk chunk) throws IOException
IOExceptionpublic void recycle()
public long getBytesWritten()
public void setBytesWritten(long bytesWritten)
public void removeSessionCookies()
Copyright © 2005–2017 Oracle Corporation. All rights reserved.