|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> [ httpPresentation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.lutris.appserver.server.httpPresentation
Interface HttpPresentationResponse

- public interface HttpPresentationResponse
Object passed to presentation objects that is used to generate HTTP responses.
- Version:
- $Revision: 1.21.2.2.4.4 $
| Field Summary | |
static int |
SC_ACCEPTED
Status code (202) indicating that a request was accepted for processing, but was not completed. |
static int |
SC_BAD_GATEWAY
Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway. |
static int |
SC_BAD_REQUEST
Status code (400) indicating the request sent by the client was syntactically incorrect. |
static int |
SC_CREATED
Status code (201) indicating the request succeeded and created a new resource on the server. |
static int |
SC_FORBIDDEN
Status code (403) indicating the server understood the request but refused to fulfill it. |
static int |
SC_INTERNAL_SERVER_ERROR
Status code (500) indicating an error inside the HTTP service which prevented it from fulfilling the request. |
static int |
SC_MOVED_PERMANENTLY
Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests. |
static int |
SC_MOVED_TEMPORARILY
Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource. |
static int |
SC_NO_CONTENT
Status code (204) indicating that the request succeeded but that there was no new information to return. |
static int |
SC_NOT_FOUND
Status code (404) indicating that the requested resource is not available. |
static int |
SC_NOT_IMPLEMENTED
Status code (501) indicating the HTTP service does not support the functionality needed to fulfill the request. |
static int |
SC_NOT_MODIFIED
Status code (304) indicating that a conditional GET operation found that the resource was available and not modified. |
static int |
SC_OK
Status code (200) indicating the request succeeded normally. |
static int |
SC_SERVICE_UNAVAILABLE
Status code (503) indicating that the HTTP service is temporarily overloaded, and unable to handle the request. |
static int |
SC_UNAUTHORIZED
Status code (401) indicating that the request requires HTTP authentication. |
| 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. |
void |
flush()
Called at the end of processing a response to force any cached headers to be written and buffers flushed. |
java.lang.String |
getEncoding()
Get the output character encoding. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the original HttpServletResponse. |
HttpPresentationOutputStream |
getOutputStream()
Returns an output stream for writing response data. |
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(com.lutris.appserver.server.session.SessionManager sessionManager)
Sets the current application name for this response |
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.enhydra.xml.io.OutputOptions outputOptions,
org.enhydra.xml.xmlc.XMLObject document)
Output an an XMLC document object (DOM). |
void |
writeDOM(org.enhydra.xml.xmlc.XMLObject 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. |
| Field Detail |
SC_OK
public static final int SC_OK
- Status code (200) indicating the request succeeded normally.
- See Also:
- Constant Field Values
SC_CREATED
public static final int SC_CREATED
- Status code (201) indicating the request succeeded and created
a new resource on the server.
- See Also:
- Constant Field Values
SC_ACCEPTED
public static final int SC_ACCEPTED
- Status code (202) indicating that a request was accepted for
processing, but was not completed.
- See Also:
- Constant Field Values
SC_NO_CONTENT
public static final int SC_NO_CONTENT
- Status code (204) indicating that the request succeeded but that
there was no new information to return.
- See Also:
- Constant Field Values
SC_MOVED_PERMANENTLY
public static final int SC_MOVED_PERMANENTLY
- Status code (301) indicating that the resource has permanently
moved to a new location, and that future references should use a
new URI with their requests.
- See Also:
- Constant Field Values
SC_MOVED_TEMPORARILY
public static final int SC_MOVED_TEMPORARILY
- Status code (302) indicating that the resource has temporarily
moved to another location, but that future references should
still use the original URI to access the resource.
- See Also:
- Constant Field Values
SC_NOT_MODIFIED
public static final int SC_NOT_MODIFIED
- Status code (304) indicating that a conditional GET operation
found that the resource was available and not modified.
- See Also:
- Constant Field Values
SC_BAD_REQUEST
public static final int SC_BAD_REQUEST
- Status code (400) indicating the request sent by the client was
syntactically incorrect.
- See Also:
- Constant Field Values
SC_UNAUTHORIZED
public static final int SC_UNAUTHORIZED
- Status code (401) indicating that the request requires HTTP
authentication.
- See Also:
- Constant Field Values
SC_FORBIDDEN
public static final int SC_FORBIDDEN
- Status code (403) indicating the server understood the request
but refused to fulfill it.
- See Also:
- Constant Field Values
SC_NOT_FOUND
public static final int SC_NOT_FOUND
- Status code (404) indicating that the requested resource is not
available.
- See Also:
- Constant Field Values
SC_INTERNAL_SERVER_ERROR
public static final int SC_INTERNAL_SERVER_ERROR
- Status code (500) indicating an error inside the HTTP service
which prevented it from fulfilling the request.
- See Also:
- Constant Field Values
SC_NOT_IMPLEMENTED
public static final int SC_NOT_IMPLEMENTED
- Status code (501) indicating the HTTP service does not support
the functionality needed to fulfill the request.
- See Also:
- Constant Field Values
SC_BAD_GATEWAY
public static final int SC_BAD_GATEWAY
- Status code (502) indicating that the HTTP server received an
invalid response from a server it consulted when acting as a
proxy or gateway.
- See Also:
- Constant Field Values
SC_SERVICE_UNAVAILABLE
public static final int SC_SERVICE_UNAVAILABLE
- Status code (503) indicating that the HTTP service is
temporarily overloaded, and unable to handle the request.
- See Also:
- Constant Field Values
| Method Detail |
getHttpServletResponse
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
- Returns the original HttpServletResponse.
setContentLength
public void setContentLength(int len)
throws HttpPresentationException
- Sets the content length for this response.
setContentType
public void setContentType(java.lang.String type) throws HttpPresentationException
- Sets the content type for this response.
createOutputOptions
public org.enhydra.xml.io.OutputOptions createOutputOptions(org.enhydra.xml.xmlc.XMLObject document) throws HttpPresentationException
- Create an OutputOptions object for a document. Options are default for
the specified document. The object maybe then modified as needed to
override the default values.
The following attributes are set in the object:
- encoding
- MIME type - Defaults for document.
- URLRewriter - Set if URL encoding of sessions is enabled.
getOutputStream
public HttpPresentationOutputStream getOutputStream() throws HttpPresentationException
- Returns an output stream for writing response data.
addCookie
public void addCookie(javax.servlet.http.Cookie cookie) throws HttpPresentationException
- Adds the specified cookie to the response. It can be called multiple
times to set more than one cookie.
containsHeader
public boolean containsHeader(java.lang.String name) throws HttpPresentationException
- Returns true if the response message header has a field with
the specified name.
setStatus
public void setStatus(int sc,
java.lang.String sm)
throws HttpPresentationException
- Sets the status code and message for this response.
setStatus
public void setStatus(int sc)
throws HttpPresentationException
- Sets the status code and a default message for this response.
setHeader
public void setHeader(java.lang.String name, java.lang.String value) throws HttpPresentationException
- Adds a field to the response header with a given name and
value. If the field had already been set, the new value
overwrites the previous one. The containsHeader method can be
used to test for the presence of a header before setting its
value.
setIntHeader
public void setIntHeader(java.lang.String name, int value) throws HttpPresentationException
- Adds a field to the response header with a given name and
integer value. If the field had already been set, the new
value overwrites the previous one. The containsHeader method
can be used to test for the presence of a header before setting
its value.
setDateHeader
public void setDateHeader(java.lang.String name, long date) throws HttpPresentationException
- Adds a field to the response header with a given name and
date-valued field. The date is specified in terms of
milliseconds since the epoch. If the date field had already
been set, the new value overwrites the previous one. The
containsHeader method can be used to test for the presence of a
header before setting its value.
sendError
public void sendError(int sc,
java.lang.String msg)
throws HttpPresentationException
- Sends an error response to the client using the specified status
code and descriptive message.
sendError
public void sendError(int sc)
throws HttpPresentationException
- Sends an error response to the client using the specified
status code and a default message.
flush
public void flush()
throws HttpPresentationException
- Called at the end of processing a response to force any cached headers to
be written and buffers flushed. This maybe a no-op if no buffering is
implemented. This is normally not called by a client.
writeDOM
public void writeDOM(org.enhydra.xml.io.OutputOptions outputOptions, org.enhydra.xml.xmlc.XMLObject document) throws HttpPresentationException
- Output an an XMLC document object (DOM). The document is formatted
according to it's type. The MIME type of the response is automatically
set.
writeDOM
public void writeDOM(org.enhydra.xml.xmlc.XMLObject document) throws HttpPresentationException
- Output an an XMLC document object (DOM). The document is formatted
according to it's type. The MIME type of the response is automatically
set.
writeHTML
public void writeHTML(java.lang.String html) throws HttpPresentationException
- Utility method to output an HTML page. The appropriate headers are
set for MIME type and to disable caching of the HTML by the broswer.
writeHTML
public void writeHTML(org.w3c.dom.html.HTMLDocument doc) throws HttpPresentationException
- Deprecated. use writeDOM
- Utility method to output an HTML page from a DOM object. The appropriate headers are set for MIME type and to disable caching of the HTML by the broswer.
- Utility method to output an HTML page from a DOM object. The appropriate headers are set for MIME type and to disable caching of the HTML by the broswer.
setEncoding
public void setEncoding(java.lang.String enc)
- Set the output character encoding.
getEncoding
public java.lang.String getEncoding()
- Get the output character encoding.
setSessionKey
public void setSessionKey(java.lang.String sessionKey)
- Sets the current session key for this response
setSessionManager
public void setSessionManager(com.lutris.appserver.server.session.SessionManager sessionManager)
- Sets the current application name for this response
isSessionIdCookieRequired
public boolean isSessionIdCookieRequired()
throws HttpPresentationException
- Indicates whether client response requires a sessionId cookie
setSessionIdCookieRequired
public void setSessionIdCookieRequired(boolean sessionIdCookie)
throws HttpPresentationException
isSessionIdEncodeUrlRequired
public boolean isSessionIdEncodeUrlRequired()
throws HttpPresentationException
- Indicates whether client response requires url encoding for
sessionId
setSessionIdEncodeUrlRequired
public void setSessionIdEncodeUrlRequired(boolean sessionIdUrl)
throws HttpPresentationException
|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> [ httpPresentation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC