public class HttpRequestHandlingMessagingGateway extends HttpRequestHandlingEndpointSupport implements org.springframework.web.HttpRequestHandler
web.xml where the servlet and bean both have the
same name. If the BaseHttpInboundEndpoint.expectReply property is set to true, a response can generated from a reply Message.
Otherwise, the gateway will play the role of a unidirectional Channel Adapter with a simple status-based response
(e.g. 200 OK).
The default supported request methods are GET and POST, but the list of values can be configured with the
RequestMapping.methods property. The payload generated from a GET request (or HEAD or OPTIONS if supported) will
be a MultiValueMap containing the parameter values. For a request containing a body (e.g. a POST), the type
of the payload is determined by the BaseHttpInboundEndpoint.setRequestPayloadTypeClass(Class) request payload type}.
If the HTTP request is a multipart and a "multipartResolver" bean has been defined in the context, then it will be
converted by the MultipartAwareFormHttpMessageConverter as long as the default message converters have not
been overwritten (although providing a customized instance of the Multipart-aware converter is also an option).
By default a number of HttpMessageConverters are already configured. The list can be overridden by calling
the HttpRequestHandlingEndpointSupport.setMessageConverters(List) method.
activeCount, expectReply, jaxb2Present, nonReadableBodyHttpMethods, romeToolsPresentmessagingTemplatelifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| Constructor and Description |
|---|
HttpRequestHandlingMessagingGateway() |
HttpRequestHandlingMessagingGateway(boolean expectReply) |
| Modifier and Type | Method and Description |
|---|---|
void |
handleRequest(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
Handles the HTTP request by generating a Message and sending it to the request channel.
|
void |
setConvertExceptions(boolean convertExceptions)
Flag to determine if conversion and writing out of message handling exceptions should be attempted (default
false, in which case they will simply be re-thrown).
|
doHandleRequest, getMessageConverters, onInit, setMergeWithDefaultConverters, setMessageConverters, setMultipartResolver, setStatusCodeIfNeeded, setupResponseAndConvertReplyafterShutdown, beforeShutdown, createEvaluationContext, evaluateHttpStatus, getComponentType, getCrossOrigin, getExtractReplyPayload, getHeaderExpressions, getHeaderMapper, getPayloadExpression, getRequestMapping, getRequestPayloadType, getStatusCodeExpression, isExpectReply, isReadable, resolveHttpStatusFromHeaders, setCrossOrigin, setExtractReplyPayload, setHeaderExpressions, setHeaderMapper, setPayloadExpression, setRequestMapping, setRequestPayloadType, setRequestPayloadTypeClass, setStatusCodeExpression, setStatusCodeExpressionStringbuildErrorMessage, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, getReplyChannel, getRequestChannel, isCountsEnabled, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerReplyMessageCorrelatorIfNecessary, reset, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, setCountsEnabled, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic HttpRequestHandlingMessagingGateway()
public HttpRequestHandlingMessagingGateway(boolean expectReply)
public void setConvertExceptions(boolean convertExceptions)
convertExceptions - the flag to setpublic final void handleRequest(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
throws javax.servlet.ServletException,
java.io.IOException
HttpMessageConverters.handleRequest in interface org.springframework.web.HttpRequestHandlerjavax.servlet.ServletExceptionjava.io.IOException