From 9bf5cba3c2bee4189aecb0dae6960a29a08d75a2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 10 Aug 2020 14:43:27 +0200 Subject: [PATCH] Drop outdated notes on handler type versus handler method restrictions Closes gh-25482 --- .../web/bind/annotation/RequestMapping.java | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 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 a0e357e8f86..eb3f0d962e1 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-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -67,8 +67,6 @@ import org.springframework.core.annotation.AliasFor; * @see PutMapping * @see DeleteMapping * @see PatchMapping - * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - * @see org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter */ @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @@ -120,9 +118,8 @@ public @interface RequestMapping { * The HTTP request methods to map to, narrowing the primary mapping: * GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE. *

Supported at the type level as well as at the method level! - * When used at the type level, all method-level mappings inherit - * this HTTP method restriction (i.e. the type-level restriction - * gets checked before the handler method is even resolved). + * When used at the type level, all method-level mappings inherit this + * HTTP method restriction. */ RequestMethod[] method() default {}; @@ -136,13 +133,8 @@ public @interface RequestMapping { * any value). Finally, "!myParam" style expressions indicate that the * specified parameter is not supposed to be present in the request. *

Supported at the type level as well as at the method level! - * When used at the type level, all method-level mappings inherit - * this parameter restriction (i.e. the type-level restriction - * gets checked before the handler method is even resolved). - *

Parameter mappings are considered as restrictions that are enforced at - * the type level. The primary path mapping (i.e. the specified URI value) - * still has to uniquely identify the target handler, with parameter mappings - * simply expressing preconditions for invoking the handler. + * When used at the type level, all method-level mappings inherit this + * parameter restriction. */ String[] params() default {}; @@ -162,9 +154,8 @@ public @interface RequestMapping { * * will match requests with a Content-Type of "text/html", "text/plain", etc. *

Supported at the type level as well as at the method level! - * When used at the type level, all method-level mappings inherit - * this header restriction (i.e. the type-level restriction - * gets checked before the handler method is even resolved). + * When used at the type level, all method-level mappings inherit this + * header restriction. * @see org.springframework.http.MediaType */ String[] headers() default {};