diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet/viewresolver.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet/viewresolver.adoc index 96d9ceb063..b6728feb67 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet/viewresolver.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet/viewresolver.adoc @@ -86,9 +86,6 @@ name (such as `redirect:/myapp/some/resource`) redirects relative to the current Servlet context, while a name such as `redirect:https://myhost.com/some/arbitrary/path` redirects to an absolute URL. -Note that, if a controller method is annotated with the `@ResponseStatus`, the annotation -value takes precedence over the response status set by `RedirectView`. - [[mvc-redirecting-forward-prefix]] == Forwarding diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/ResponseStatus.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/ResponseStatus.java index f69fef63fc..129605eec4 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/ResponseStatus.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/ResponseStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2023 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. @@ -30,8 +30,8 @@ import org.springframework.http.HttpStatus; * {@link #reason} that should be returned. * *

The status code is applied to the HTTP response when the handler - * method is invoked and overrides status information set by other means, - * like {@code ResponseEntity} or {@code "redirect:"}. + * method is invoked, but does not override status information set by other + * means, such as {@code ResponseEntity} or {@code "redirect:"}. * *

Warning: when using this annotation on an exception * class, or when setting the {@code reason} attribute of this annotation,