A Response
acts as a wrapper for an http response.
{@link Response} represents a HTTP response and offers methods to retrieve status code, HTTP versionand headers.
{@link Response} objects are passed as parameters to {@link Response.Listener} callbacks, or asfuture result of {@link Request#send()}.
{@link Response} objects do not contain getters for the response content, because it may be too largeto fit into memory. The response content should be retrieved via {@link Response.Listener#onContent(Response,ByteBuffer) contentevents}, or via utility classes such as {@link BufferingResponseListener}.
com.google.gwt.http.HTTP
. {@gwt.include com/google/gwt/examples/http/InheritsExample.gwt.xml}
You get back a response with the same [token] as your query.
100rel
MUST NOT be present in any requests excepting INVITE, although other extensions to SIP may allow its usage with other request methods. If the UAC does not wish to insist on usage of reliable provisional responses, but merely indicate that it supports them if the UAS needs to send one, a Supported header MUST be included in the request with the option tag 100rel
. The UAC SHOULD include this in all INVITE requests. A UAS MAY send any non-100 provisional response to INVITE reliably, so long as the initial INVITE request (the request whose provisional response is being sent reliably) contained a Supported header field with the option tag 100rel
. The provisional response to be sent reliably is constructed by the UAS and MUST contain a Require header field containing the option tag 100rel
, and MUST include an RSeq header field. Retransmissions of the reliable provisional response cease when a matching PRACK is received by the UA core. PRACK is like any other request within a dialog, and is treated likewise. A matching PRACK is defined as one within the same dialog as the response, and whose method, CSeq-num, and RSeq-num in the RAck header field match, respectively, the method and sequence number from the CSeq and the sequence number from the RSeq of the reliable provisional response.
SIP applications are not required to understand the meaning of all registered response codes, though such understanding is obviously desirable. However, applications must understand the class of any status code, as indicated by the first digit and outlined above. Applications treat any unrecognized status code as being equivalent to the x00 status code of that class, with the exception that an unrecognized status code must not be cached. For example, if a client receives an unrecognized status code of 431, it can safely assume that there was something wrong with its request and treat the Response as if it had received a BAD_REQUEST(400) status code. In such cases, user agents should present to the user the message body returned with the Response, since that message body is likely to include human-readable information which will explain the unusual status.
This specification supports the response codes defined in RFC3261 and also the response code extensions for the event notification framework and PUBLISH, documented in RFC3265 and RFC3909, these are highlighted in italic. Class status codes (x00, i.e. 100) are are highlighted in bold.
Class | Code |
PROVISIONAL (1xx) | |
SUCCESS (2xx) | |
REDIRECTION (3xx) | |
CLIENT_ERROR (4xx) | |
SERVER_ERROR (5xx) | |
GLOBAL_ERROR (6xx) | |
An application class should not extend this class directly. {@code Response} class isreserved for an extension by a JAX-RS implementation providers. An application should use one of the static methods to create a {@code Response} instance using a ResponseBuilder.
Several methods have parameters of type URI, {@link UriBuilder} providesconvenient methods to create such values as does {@link URI#create(java.lang.String)}.
@author Paul Sandoz @author Marc Hadley @author Marek Potociar @see Response.ResponseBuilder @since 1.0Response
interface provides methods used to obtain the payload and context of a message sent in response to an operation invocation. For asynchronous operation invocations it provides additional methods to check the status of the request. The get(...)
methods may throw the standard set of exceptions and their cause may be a RemoteException
or a {@link WebServiceException} that represents the error that occured during theasynchronous method invocation.
A Response.View
response instructs Juzu to proceed to the render phase of a valid view controller, this kind of response can be created using an {@link juzu.request.ActionContext}, however the best way is to use a controller companion class that carries method factories for creating render responses.
Type safe {@link juzu.Response.View} factory method are generated for each view or resource controllermethods. The signature of an render factory is obtained by using the same signature of the controller method.
public class MyController { @Action public {@link juzu.Response.View} myAction() {return MyController_.myView("hello"); } @View public void myView(String param) { } }
Mime response are used by the {@link juzu.request.Phase#VIEW} and the {@link juzu.request.Phase#RESOURCE} phases.Both contains a content to be streamed to the client but still they have some noticeable differences.
The {@link juzu.Response.Content} class is the base response class which will work well for the two phases.However the {@link juzu.request.Phase#VIEW} can specify an optional title and the {@link juzu.request.Phase#RESOURCE}can specify an optional status code for the user agent response.
Responses are created using the {@link Response} factory methods such as
Response can also created from {@link juzu.template.Template} directly:
public class MyController { @Inject @Path("index.gtmpl") {@link juzu.template.Template} index;@View public {@link juzu.Response.Content} myView() {return index.ok(); } @Inject @Path("error.gtmpl") {@link juzu.template.Template} error;@Resource public {@link juzu.Response.Content} myView() {return error.notFound(); } }
The {@link juzu.template.Template.Builder} can also create responses:
public class MyController { @Inject @Path("index.gtmpl") index index; @View public {@link juzu.Response.Content} myView() {return index.with().label("hello").ok(); } }
@author Julien Viet
ServletResponse
that is to be produced, based on the processing of a corresponding Request
.
@author Craig R. McClanahan
@version $Revision: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
Response
object represents an RPC response. Both the client and the server use Response
objects to represent the result of a method invocation.
@author Matthew J. Duftler (duftler@us.ibm.com)
@author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
The implementation may not support calling both {@link #write(byte[])} and{@link #write(CharSequence)} on the same {@link Response} instance. @author Matej Knopp @author igor.vaynberg
response
XML element per the WebDAV specification [RFC 4918] Name: response Namespace: DAV: Purpose: Holds a single response describing the effect of a method on resource and/or its properties. Description: A particular href MUST NOT appear more than once as the child of a response XML element under a multistatus XML element. This requirement is necessary in order to keep processing costs for a response to linear time. Essentially, this prevents having to search in order to group together all the responses by href. There are, however, no requirements regarding ordering based on href values. <!ELEMENT response (href, ((href*, status)|(propstat+)), responsedescription?) >
{@link Response} represents a HTTP response and offers methods to retrieve status code, HTTP versionand headers.
{@link Response} objects are passed as parameters to {@link Response.Listener} callbacks, or asfuture result of {@link Request#send()}.
{@link Response} objects do not contain getters for the response content, because it may be too largeto fit into memory. The response content should be retrieved via {@link Response.Listener#onContent(Response,ByteBuffer) contentevents}, or via utility classes such as {@link BufferingResponseListener}.
{@link Response} provides the implementation for {@link HttpServletResponse}.
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Response
wraps the result of a remote method invocation
@author Tim Anderson
@version $Revision: 1.1 $ $Date: 2004/11/26 01:51:03 $
@see Request
@see Connection
A response must specify the following information:
Optionally, a response may declare a well-known name for it. This well known name corresponds to the "outputFormat" parameter which is supported on many types of OWS request.
@author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.orgResponse is a {@link Message} object that will read itself from a {@link InputStream} upon demand. It is provided by {@link Protocol}s as the result of a call to {@link Protocol#createResponse(Command)}. A Response is a generalize contract and does not provide the necessary semantics corresponding to the data for the various response possibilities (such as bulk data to a collection, value to bytes, etc.)
This specification also does not specify whether a response object can be reused (to read the same command type response). This is left to the provider of the implementation. If a provider does NOT wish to re-use responses, they should raise a {@link ProviderException} in any subsequent calls to{@link Response#read(InputStream)}. This class, however, does not and will not provide a 'reset' means. / [TODO: document me!] @author Joubin Houshyar (alphazero@sensesay.net) @version alpha.0, 04/02/09 @since alpha.0
Implements {@link javax.servlet.HttpServletResponse} from the {@link javax.servlet} package.
@author gregw Response
element behaves.
OutputStream
can be acquired via this interface which can be used to write the response body. A buffer size can be specified when acquiring the output stream which allows data to be buffered until it over flows or is flushed explicitly. This buffering allows a partially written response body to be reset. This should never allow the message body be sent if it should not be sent with the headers as of RFC 2616 rules for the presence of a message body. A message body must not be included with a HEAD request or with a 304 or a 204 response. A proper implementation of this will prevent a message body being sent if the response is to a HEAD request of if there is a 304 or 204 response code.
It is important to note that the Response
controls the processing of the HTTP pipeline. The next HTTP request is not processed until the response has been sent. To ensure that the response is sent the close
method of the response or the output stream should be used. This will notify the server to dispatch the next request in the pipeline for processing.
@author Niall Gallagher
The work flow for this kind of objects is divided in two parts: the first is executing a request and the second writing the result to an OuputStream.
Note: abort() will be called as part of error handling giving your response subclass a chance to clean up any temporary resources it may have required in execute() for use in writeTo().
This is specially usefull for streamed responses such as wfs GetFeature or WMS GetMap, where the execution process can be used to parse parameters, execute queries upon the corresponding data sources and leave things ready to generate a streamed response when the consumer calls writeTo.
@author Gabriel Rold?n @version $Id: Response.java 11475 2009-02-28 18:41:23Z jdeolive $The headers and status are configured, before committing the response with one of the {@link #send} methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|