From eb6bd2d7b8752bd1100fff45e95cc5f088146f26 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 26 Sep 2017 15:29:58 -0400 Subject: [PATCH] Remove args and return value lists from @RequestMapping It is no longer adequate to list supported arguments and return values -- between Web MVC and WebFlux, directly on the annotation. Instead we have tables in the respective chapters in the reference with cross references to each other. Issue: SPR-15149 --- .../web/bind/annotation/RequestMapping.java | 210 +----------------- 1 file changed, 8 insertions(+), 202 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java index 596a834cb56..28a923c0181 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.util.concurrent.Callable; import org.springframework.core.annotation.AliasFor; @@ -29,205 +28,12 @@ import org.springframework.core.annotation.AliasFor; * Annotation for mapping web requests onto specific handler classes and/or * handler methods. * - *

Handler methods which are annotated with this annotation are allowed to - * have very flexible signatures. They may have parameters of the following - * types, in arbitrary order (except for validation results, which need to - * follow right after the corresponding command object, if desired): - *

- * - *

Note: Java 8's {@code java.util.Optional} is supported - * as a method parameter type with annotations that provide a {@code required} - * attribute (e.g. {@code @RequestParam}, {@code @RequestHeader}, etc.). The use - * of {@code java.util.Optional} in those cases is equivalent to having - * {@code required=false}. - * - *

The following return types are supported for handler methods: - *

+ *

Handler methods annotated with this annotation can have very flexible + * signatures. The exact details of the supported method arguments and return + * values depend on the specific + * {@link org.springframework.stereotype.Controller @Controller} model supported. + * Both Spring Web MVC and Spring WebFlux support this annotation with some + * differences. More details are available in the Spring Framework reference. * *

NOTE: {@code @RequestMapping} will only be processed if an * an appropriate {@code HandlerMapping}-{@code HandlerAdapter} pair @@ -256,8 +62,8 @@ import org.springframework.core.annotation.AliasFor; * @see SessionAttribute * @see SessionAttributes * @see InitBinder - * @see org.springframework.web.context.request.WebRequest * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter + * @see org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter */ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)