|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.endpoint.AbstractEndpoint org.springframework.integration.gateway.MessagingGatewaySupport org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport org.springframework.integration.http.inbound.HttpRequestHandlingController
public class HttpRequestHandlingController
Inbound HTTP endpoint that implements Spring's Controller
interface to be used with a DispatcherServlet front
controller.
viewName
will be passed into the ModelAndView return value.
This endpoint will have request/reply behavior by default. That can be overridden by passing false
to
the constructor. In the request/reply case, the core map will be passed to the view, and it will contain either the
reply Message or payload depending on the value of HttpRequestHandlingEndpointSupport.extractReplyPayload
(true by default, meaning just the
payload). The corresponding key in the map is determined by the replyKey
property (with a default of
"reply").
Field Summary |
---|
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
HttpRequestHandlingController()
|
|
HttpRequestHandlingController(boolean expectReply)
|
Method Summary | |
---|---|
org.springframework.web.servlet.ModelAndView |
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. |
protected void |
onInit()
Locates the MultipartResolver bean based on the default name defined by the
DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME constant if available. |
void |
setErrorCode(java.lang.String errorCode)
The error code to use to signal an error in the message handling. |
void |
setErrorsKey(java.lang.String errorsKey)
The key used to expose Errors in the core, in the case that message handling fails. |
void |
setReplyKey(java.lang.String replyKey)
Specify the key to be used when adding the reply Message or payload to the core map (will be payload only unless the value of HttpRequestHandlingEndpointSupport.setExtractReplyPayload(boolean) is false ). |
void |
setViewExpression(org.springframework.expression.Expression viewExpression)
Specifies a SpEL expression to evaluate in order to generate the view name. |
void |
setViewName(java.lang.String viewName)
Specify the view name. |
Methods inherited from class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport |
---|
afterShutdown, beforeShutdown, createEvaluationContext, doHandleRequest, doStart, getComponentType, getMessageConverters, isExpectReply, isShuttingDown, setExtractReplyPayload, setHeaderExpressions, setHeaderMapper, setMessageConverters, setMultipartResolver, setPath, setPayloadExpression, setRequestPayloadType, setSupportedMethodNames, setSupportedMethods, setupResponseAndConvertReply, setupResponseAndConvertReply |
Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport |
---|
doStop, receive, send, sendAndReceive, sendAndReceiveMessage, setErrorChannel, setReplyChannel, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestMapper, setRequestTimeout, setShouldTrack |
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
Constructor Detail |
---|
public HttpRequestHandlingController()
public HttpRequestHandlingController(boolean expectReply)
Method Detail |
---|
public void setViewName(java.lang.String viewName)
public void setReplyKey(java.lang.String replyKey)
HttpRequestHandlingEndpointSupport.setExtractReplyPayload(boolean)
is false
). The
default key is "reply".
public void setErrorsKey(java.lang.String errorsKey)
Errors
in the core, in the case that message handling fails. Defaults to
"errors".
errorsKey
- the key value to setpublic void setErrorCode(java.lang.String errorCode)
MessageSource
.
The default value is spring.integration.http.handler.error
. Three arguments are provided: the
exception, its message and its stack trace as a String.
errorCode
- the error code to setpublic void setViewExpression(org.springframework.expression.Expression viewExpression)
protected void onInit() throws java.lang.Exception
HttpRequestHandlingEndpointSupport
MultipartResolver
bean based on the default name defined by the
DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME
constant if available.
onInit
in class HttpRequestHandlingEndpointSupport
java.lang.Exception
public final org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse) throws java.lang.Exception
handleRequest
in interface org.springframework.web.servlet.mvc.Controller
java.lang.Exception
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |