diff --git a/src/docbkx/http.xml b/src/docbkx/http.xml index b16fc37ffb..562787ed6d 100644 --- a/src/docbkx/http.xml +++ b/src/docbkx/http.xml @@ -14,27 +14,27 @@
Http Inbound Gateway - To receive messages over HTTP you need to use an HttpInboundEndpoint. In common with the HttpInvoker - support the Http Inbound Gateway needs to be deployed within a servlet container. The easiest way to do this is to provide a servlet + To receive messages over HTTP you need to use an HTTP inbound Channel Adapter or Gateway. In common with the HttpInvoker + support the HTTP inbound adapters need to be deployed within a servlet container. The easiest way to do this is to provide a servlet definition in web.xml, see - for further details. Below is an example bean definition for a simple HttpInboundEndpoint - + for further details. Below is an example bean definition for a simple HTTP inbound endpoint. + ]]> - The HttpInboundEndpoint accepts an instance of InboundRequestMapper which allows - customisation of the mapping from HttpServletRequest to Message. If none is - provided an instance of DefaultInboundRequestMapper will be used. This encapsulates a simple strategy, which for + The HttpRequestHandlingMessagingGateway accepts a list of HttpMessageConverter instances or else + relies on a default list. The converters allow + customization of the mapping from HttpServletRequest to Message. The default converters + encapsulate simple strategies, which for example will create a String message for a POST request where the content type starts with "text", see the Javadoc for - full details. + full details. Starting with this release MultiPart File support was implemented. If the request has been wrapped as a - MultipartHttpServletRequest, then the 'content type' can be checked. If it is known, and - begins with "text", then the MultipartFile will be copied to a String in the parameter - map. If the content type does not begin with "text", then the MultipartFile will be copied - to a byte array within the parameter map instead. + MultipartHttpServletRequest, when using the default converters, that request will be converted + to a Message payload that is a MultiValueMap containing values that may be byte arrays, Strings, or instances of + Spring's MultipartFile depending on the content type of the individual parts. - The HttpInboundEndpoint will locate a MultipartResolver in the context if one exists with the bean name + The HTTP inbound Endpoint will locate a MultipartResolver in the context if one exists with the bean name "multipartResolver" (the same name expected by Spring's DispatcherServlet). If it does in fact locate that bean, then the support for MultipartFiles will be enabled on the inbound request mapper. Otherwise, it will fail when trying to map a multipart-file request to a Spring Integration Message. For more on Spring's @@ -43,28 +43,30 @@ In sending a response to the client there are a number of ways to customize the behavior of the gateway. By default the gateway will - simply acknowledge that the request was received by sending a 200 status code back. It is possible to customize this response by providing an - implementation of the Spring MVC View which will be invoked with the created Message. - In the case that the gateway should expect a reply to the Message then setting the expectReply flag will cause - the gateway to wait for a response Message before creating an Http response. Below is an example of a gateway - configured to use a custom view and to wait for a response. It also shows how to customize the Http methods accepted by the gateway, which + simply acknowledge that the request was received by sending a 200 status code back. It is possible to customize this response by providing a + 'viewName' to be resolved by the Spring MVC ViewResolver. + In the case that the gateway should expect a reply to the Message then setting the expectReply flag + (constructor argument) will cause + the gateway to wait for a reply Message before creating an HTTP response. Below is an example of a gateway + configured to serve as a Spring MVC Controller with a view name. Because of the constructor arg value of TRUE, it wait for a reply. This also shows + how to customize the HTTP methods accepted by the gateway, which are POST and GET by default. - + + - - + + GET DELETE - ]]> - The message created from the request will be available in the Model map. The key that is used - for that map entry by default is 'requestMessage', but this can be overridden by setting the - 'requestKey' property on the endpoint's configuration. + The reply message will be available in the Model map. The key that is used + for that map entry by default is 'reply', but this can be overridden by setting the + 'replyKey' property on the endpoint's configuration.