|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.appserver.server.httpPresentation.servlet.ServletHttpPresentationResponse
Object passed to presentation objects that is used to generate HTTP responses.
Field Summary |
Fields inherited from interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse |
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CREATED, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_NO_CONTENT, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_SERVICE_UNAVAILABLE, SC_UNAUTHORIZED |
Constructor Summary | |
protected |
ServletHttpPresentationResponse(javax.servlet.http.HttpServletResponse response,
org.apache.log4j.Logger domStatsLogger)
Construct an object associated with a servlet response. |
Method Summary | |
void |
addCookie(javax.servlet.http.Cookie cookie)
Adds the specified cookie to the response. |
boolean |
containsHeader(java.lang.String name)
Returns true if the response message header has a field with the specified name. |
OutputOptions |
createOutputOptions(XMLObject document)
Create an OutputOptions object for a document. |
java.lang.String |
encodeRedirectUrl(java.lang.String url)
Encodes a url with session id for sendRedirect for use with cookieless browsers. |
java.lang.String |
encodeUrl(java.lang.String url)
Encodes a url with session id for use with cookieless browsers. |
void |
flush()
Called at the end of processing a response to force any cached headers to be written and buffers flushed. |
int |
getContentLength()
Returns the size of the request entity data, or -1 if not available. |
java.lang.String |
getContentType()
Returns the Internet Media Type of the response, or null if not known This is necessary to support the DebugResponse interface. |
javax.servlet.http.Cookie[] |
getCookies()
Returns an array of cookies to be set by this response, or a 0 length array if the information is not available. |
java.lang.String |
getEncoding()
Get the output character encoding. |
java.lang.String |
getHeader(java.lang.String name)
Returns the values of the specified header for the response as an array of strings, or a 0 length array if the named header does not exist. |
java.util.Enumeration |
getHeaderNames()
Returns an array of strings representing the header names for this response. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the original HttpServletResponse. |
HttpPresentationOutputStream |
getOutputStream()
Returns an output stream for writing response data. |
java.lang.String |
getResponseData()
Returns null. |
int |
getStatusCode()
Returns the status code for the response, or -1 if not available. |
java.lang.String |
getStatusMessage()
Returns the status message for the response, or null if not available. |
int |
getTotalBytes()
Returns the total number of bytes that make up this response. |
boolean |
isSessionIdCookieRequired()
Indicates whether client response requires a sessionId cookie |
boolean |
isSessionIdEncodeUrlRequired()
Indicates whether client response requires url encoding for sessionId |
void |
sendError(int sc)
Sends an error response to the client using the specified status code and a default message. |
void |
sendError(int sc,
java.lang.String msg)
Sends an error response to the client using the specified status code and descriptive message. |
void |
setContentLength(int len)
Sets the content length for this response. |
void |
setContentType(java.lang.String type)
Sets the content type for this response. |
void |
setDateHeader(java.lang.String name,
long date)
Adds a field to the response header with a given name and date-valued field. |
void |
setEncoding(java.lang.String enc)
Set the output character encoding. |
void |
setHeader(java.lang.String name,
java.lang.String value)
Adds a field to the response header with a given name and value. |
void |
setIntHeader(java.lang.String name,
int value)
Adds a field to the response header with a given name and integer value. |
void |
setSessionIdCookieRequired(boolean sessionIdCookie)
|
void |
setSessionIdEncodeUrlRequired(boolean sessionIdUrl)
|
void |
setSessionKey(java.lang.String sessionKey)
Sets the current session key for this response |
void |
setSessionManager(SessionManager sessionManager)
Sets the session manager. |
void |
setStatus(int sc)
Sets the status code and a default message for this response. |
void |
setStatus(int sc,
java.lang.String sm)
Sets the status code and message for this response. |
void |
writeDOM(OutputOptions outputOptions,
XMLObject document)
Output an an XMLC document object (DOM). |
void |
writeDOM(XMLObject document)
Output an an XMLC document object (DOM). |
void |
writeHTML(HTMLDocument doc)
Deprecated. use writeDOM |
void |
writeHTML(java.lang.String html)
Utility method to output an HTML page. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ServletHttpPresentationResponse(javax.servlet.http.HttpServletResponse response, org.apache.log4j.Logger domStatsLogger)
response
- Servlet response object that this object will front-end.Method Detail |
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
getHttpServletResponse
in interface HttpPresentationResponse
public void setContentLength(int len) throws HttpPresentationException
setContentLength
in interface HttpPresentationResponse
len
- the content length
HttpPresentationException
public void setContentType(java.lang.String type) throws HttpPresentationException
setContentType
in interface HttpPresentationResponse
type
- the content's MIME type
HttpPresentationException
public HttpPresentationOutputStream getOutputStream() throws HttpPresentationException
getOutputStream
in interface HttpPresentationResponse
HttpPresentationException
public void addCookie(javax.servlet.http.Cookie cookie) throws HttpPresentationException
addCookie
in interface HttpPresentationResponse
cookie
- - The Cookie to return to the client.
HttpPresentationException
public boolean containsHeader(java.lang.String name) throws HttpPresentationException
containsHeader
in interface HttpPresentationResponse
name
- the header field name
HttpPresentationException
public void setStatus(int sc, java.lang.String sm) throws HttpPresentationException
setStatus
in interface HttpPresentationResponse
sc
- the status codesm
- the status message
HttpPresentationException
public void setStatus(int sc) throws HttpPresentationException
setStatus
in interface HttpPresentationResponse
sc
- the status code
HttpPresentationException
public void setHeader(java.lang.String name, java.lang.String value) throws HttpPresentationException
setHeader
in interface HttpPresentationResponse
name
- the header field namevalue
- the header field value
HttpPresentationException
public void setIntHeader(java.lang.String name, int value) throws HttpPresentationException
setIntHeader
in interface HttpPresentationResponse
name
- the header field namevalue
- the header field integer value
HttpPresentationException
public void setDateHeader(java.lang.String name, long date) throws HttpPresentationException
setDateHeader
in interface HttpPresentationResponse
name
- the header field name
HttpPresentationException
public void sendError(int sc, java.lang.String msg) throws HttpPresentationException
sendError
in interface HttpPresentationResponse
sc
- the status codemsg
- the detail message
HttpPresentationException
public void sendError(int sc) throws HttpPresentationException
sendError
in interface HttpPresentationResponse
sc
- the status code
HttpPresentationException
public void flush() throws HttpPresentationException
flush
in interface HttpPresentationResponse
HttpPresentationException
public java.lang.String encodeUrl(java.lang.String url)
url
- the url to be encoded.
public java.lang.String encodeRedirectUrl(java.lang.String url)
url
- the url to be encoded.
#sendRedirect
,
encodeUrl(java.lang.String)
public int getContentLength()
getContentLength
in interface DebugResponse
DebugResponse
public java.lang.String getContentType()
getContentType
in interface DebugResponse
DebugResponse
public int getStatusCode()
getStatusCode
in interface DebugResponse
DebugResponse
public java.lang.String getStatusMessage()
getStatusMessage
in interface DebugResponse
DebugResponse
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface DebugResponse
DebugResponse
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface DebugResponse
name
- the case-insensitive header field name
DebugResponse
public java.util.Enumeration getHeaderNames()
getHeaderNames
in interface DebugResponse
DebugResponse
public int getTotalBytes()
getTotalBytes
in interface DebugResponse
DebugResponse
public java.lang.String getResponseData()
getResponseData
in interface DebugResponse
public void setEncoding(java.lang.String enc)
setEncoding
in interface HttpPresentationResponse
enc
- character encodingpublic java.lang.String getEncoding()
getEncoding
in interface HttpPresentationResponse
public void setSessionKey(java.lang.String sessionKey)
setSessionKey
in interface HttpPresentationResponse
sessionKey
- The current sessionKeypublic void setSessionManager(SessionManager sessionManager)
setSessionManager
in interface HttpPresentationResponse
public boolean isSessionIdCookieRequired() throws HttpPresentationException
isSessionIdCookieRequired
in interface HttpPresentationResponse
HttpPresentationException
public void setSessionIdCookieRequired(boolean sessionIdCookie) throws HttpPresentationException
setSessionIdCookieRequired
in interface HttpPresentationResponse
HttpPresentationException
public boolean isSessionIdEncodeUrlRequired() throws HttpPresentationException
isSessionIdEncodeUrlRequired
in interface HttpPresentationResponse
HttpPresentationException
public void setSessionIdEncodeUrlRequired(boolean sessionIdUrl) throws HttpPresentationException
setSessionIdEncodeUrlRequired
in interface HttpPresentationResponse
HttpPresentationException
public OutputOptions createOutputOptions(XMLObject document) throws HttpPresentationException
The following attributes are set in the object:
createOutputOptions
in interface HttpPresentationResponse
HttpPresentationException
public void writeDOM(OutputOptions outputOptions, XMLObject document) throws HttpPresentationException
writeDOM
in interface HttpPresentationResponse
HttpPresentationException
public void writeDOM(XMLObject document) throws HttpPresentationException
writeDOM
in interface HttpPresentationResponse
HttpPresentationException
public void writeHTML(java.lang.String html) throws HttpPresentationException
writeHTML
in interface HttpPresentationResponse
HttpPresentationException
public void writeHTML(HTMLDocument doc) throws HttpPresentationException
writeHTML
in interface HttpPresentationResponse
doc
- The DOM object to be returned as response
HttpPresentationException
HttpPresentationResponse.writeDOM(org.enhydra.xml.io.OutputOptions, org.enhydra.xml.xmlc.XMLObject)
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |