|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.httpPresentation.servlet.ServletHttpPresentationResponse
public class 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,
java.io.PrintWriter domStatsLogWriter)
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. |
org.enhydra.xml.io.OutputOptions |
createOutputOptions(org.enhydra.xml.xmlc.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. |
com.lutris.appserver.server.httpPresentation.HttpPresentationOutputStream |
getOutputStream()
Returns an output stream for writing response data. |
ResponsePostProcessingManager |
getPostProcessingManager()
Returns the response post processing manager. |
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 |
setPostProcessingManager(ResponsePostProcessingManager processingManager)
Sets the response post processing manager. |
void |
setSessionIdCookieRequired(boolean sessionIdCookie)
|
void |
setSessionIdEncodeUrlRequired(boolean sessionIdUrl)
|
void |
setSessionKey(java.lang.String sessionKey)
Sets the current session key for this response |
void |
setSessionManager(com.lutris.appserver.server.session.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(org.w3c.dom.Node document)
Output an an XMLC document object (DOM). |
void |
writeDOM(org.enhydra.xml.io.OutputOptions outputOptions,
org.w3c.dom.Node document)
Output an an XMLC document object (DOM). |
void |
writeHTML(org.w3c.dom.html.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, java.io.PrintWriter domStatsLogWriter)
response
- Servlet response object that this object will front-end.Method Detail |
---|
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
getHttpServletResponse
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
public void setContentLength(int len) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setContentLength
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
len
- the content length
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setContentType(java.lang.String type) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setContentType
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
type
- the content's MIME type
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public com.lutris.appserver.server.httpPresentation.HttpPresentationOutputStream getOutputStream() throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
getOutputStream
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void addCookie(javax.servlet.http.Cookie cookie) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
addCookie
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
cookie
- - The Cookie to return to the client.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public boolean containsHeader(java.lang.String name) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
containsHeader
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
name
- the header field name
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setStatus(int sc, java.lang.String sm) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setStatus
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
sc
- the status codesm
- the status message
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setStatus(int sc) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setStatus
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
sc
- the status code
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setHeader(java.lang.String name, java.lang.String value) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setHeader
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
name
- the header field namevalue
- the header field value
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setIntHeader(java.lang.String name, int value) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setIntHeader
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
name
- the header field namevalue
- the header field integer value
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setDateHeader(java.lang.String name, long date) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setDateHeader
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
name
- the header field namevalue
- the header field date value
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void sendError(int sc, java.lang.String msg) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
sendError
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
sc
- the status codemsg
- the detail message
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void sendError(int sc) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
sendError
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
sc
- the status code
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void flush() throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
flush
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.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()
com.lutris.http.debug.DebugResponse
public java.lang.String getContentType()
com.lutris.http.debug.DebugResponse
public int getStatusCode()
com.lutris.http.debug.DebugResponse
public java.lang.String getStatusMessage()
com.lutris.http.debug.DebugResponse
public javax.servlet.http.Cookie[] getCookies()
com.lutris.http.debug.DebugResponse
public java.lang.String getHeader(java.lang.String name)
name
- the case-insensitive header field name
com.lutris.http.debug.DebugResponse
public java.util.Enumeration getHeaderNames()
com.lutris.http.debug.DebugResponse
public int getTotalBytes()
com.lutris.http.debug.DebugResponse
public java.lang.String getResponseData()
public void setEncoding(java.lang.String enc)
setEncoding
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
enc
- character encodingpublic java.lang.String getEncoding()
getEncoding
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
public void setSessionKey(java.lang.String sessionKey)
setSessionKey
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
sessionKey
- The current sessionKeypublic void setSessionManager(com.lutris.appserver.server.session.SessionManager sessionManager)
setSessionManager
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
public void setPostProcessingManager(ResponsePostProcessingManager processingManager)
setPostProcessingManager
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
processingManager
- public ResponsePostProcessingManager getPostProcessingManager()
getPostProcessingManager
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
public boolean isSessionIdCookieRequired() throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
isSessionIdCookieRequired
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setSessionIdCookieRequired(boolean sessionIdCookie) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setSessionIdCookieRequired
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public boolean isSessionIdEncodeUrlRequired() throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
isSessionIdEncodeUrlRequired
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void setSessionIdEncodeUrlRequired(boolean sessionIdUrl) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
setSessionIdEncodeUrlRequired
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public org.enhydra.xml.io.OutputOptions createOutputOptions(org.enhydra.xml.xmlc.XMLObject document) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
The following attributes are set in the object:
createOutputOptions
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void writeDOM(org.enhydra.xml.io.OutputOptions outputOptions, org.w3c.dom.Node document) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
writeDOM
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
outputFormat
- Object use to specify options controlling formatting of the
document.doc
- The DOM object to be returned as response.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void writeDOM(org.w3c.dom.Node document) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
writeDOM
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
doc
- The DOM object to be returned as response.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void writeHTML(java.lang.String html) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
writeHTML
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public void writeHTML(org.w3c.dom.html.HTMLDocument doc) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
writeHTML
in interface com.lutris.appserver.server.httpPresentation.HttpPresentationResponse
doc
- The DOM object to be returned as response
com.lutris.appserver.server.httpPresentation.HttpPresentationException
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |