From 4e9d22eb7b2cbbd4a92a5586595e36c4e02bf23a Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Wed, 6 Jun 2012 10:36:02 -0400 Subject: [PATCH] INT-2516 Warn for Invalid request-payload-type Issue initialization warning on inappropriate request-payload-type attribute on Http Inbound Endpoint. --- .../HttpRequestHandlingEndpointSupport.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java index e0353e5306..d14a469cf0 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java @@ -296,6 +296,8 @@ abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySuppor } } } + + this.validateSupportedMethods(); } /** @@ -512,4 +514,17 @@ abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySuppor } return evaluationContext; } + + private void validateSupportedMethods() { + if (this.requestPayloadType != null){ + for (HttpMethod httpMethod : this.supportedMethods) { + if (HttpMethod.GET.equals(httpMethod) || HttpMethod.HEAD.equals(httpMethod) || HttpMethod.OPTIONS.equals(httpMethod)){ + if (logger.isWarnEnabled()){ + logger.warn("The 'requestPayloadType' attribute will have no relevance for one of the specified HTTP methods '" + + httpMethod + "'"); + } + } + } + } + } }