From 0fdc63007a2c0931b0a79a074440b47108245020 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Sat, 30 May 2015 09:22:32 -0400 Subject: [PATCH] INT-3723: Fix HTTP Module for Recent SF Changes JIRA: https://jira.spring.io/browse/INT-3723 Since `RequestMappingHandlerMapping` has reverted to `@RequestMapping` parsing, restore the previous logic with `@RequestMapping` generation in the `IntegrationRequestMappingHandlerMapping` Use `AnnotationUtils.synthesizeAnnotation` instead of direct annotation creation through the inline impl --- build.gradle | 2 +- .../inbound/IntegrationRequestMappingHandlerMapping.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index de81ac2777..08fc41d0d4 100644 --- a/build.gradle +++ b/build.gradle @@ -131,7 +131,7 @@ subprojects { subproject -> springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '4.0.1.RELEASE' springSocialTwitterVersion = '1.1.0.RELEASE' springRetryVersion = '1.1.2.RELEASE' - springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.RC1' + springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.BUILD-SNAPSHOT' springWsVersion = '2.2.1.RELEASE' xmlUnitVersion = '1.5' xstreamVersion = '1.4.7' diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java index 7bf07bb1a9..8e0c92be10 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.core.annotation.AnnotationAttributes; +import org.springframework.core.annotation.AnnotationUtils; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.ReflectionUtils; @@ -173,6 +174,7 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin Map requestMappingAttributes = new HashMap(); requestMappingAttributes.put("name", endpoint.getComponentName()); + requestMappingAttributes.put("value", requestMapping.getPathPatterns()); requestMappingAttributes.put("path", requestMapping.getPathPatterns()); requestMappingAttributes.put("method", requestMapping.getRequestMethods()); requestMappingAttributes.put("params", requestMapping.getParams()); @@ -180,8 +182,10 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin requestMappingAttributes.put("consumes", requestMapping.getConsumes()); requestMappingAttributes.put("produces", requestMapping.getProduces()); - return createRequestMappingInfo(AnnotationAttributes.fromMap(requestMappingAttributes), - getCustomTypeCondition(endpoint.getClass())); + org.springframework.web.bind.annotation.RequestMapping requestMappingAnnotation = + AnnotationUtils.synthesizeAnnotation(requestMappingAttributes, + org.springframework.web.bind.annotation.RequestMapping.class, null); + return createRequestMappingInfo(requestMappingAnnotation, getCustomTypeCondition(endpoint.getClass())); } @Override