提交 55db4ae9 编写于 作者: B Brian Clozel

Document that @ResponseStatus overrides redirect views

Issue: SPR-13439
上级 583a48ab
...@@ -30,7 +30,8 @@ import org.springframework.http.HttpStatus; ...@@ -30,7 +30,8 @@ import org.springframework.http.HttpStatus;
* {@link #reason} that should be returned. * {@link #reason} that should be returned.
* *
* <p>The status code is applied to the HTTP response when the handler * <p>The status code is applied to the HTTP response when the handler
* method is invoked. * method is invoked and overrides status information set by other means,
* like {@code ResponseEntity} or {@code "redirect:"}.
* *
* <p><strong>Warning</strong>: when using this annotation on an exception * <p><strong>Warning</strong>: when using this annotation on an exception
* class, or when setting the {@code reason} attribute of this annotation, * class, or when setting the {@code reason} attribute of this annotation,
......
...@@ -2789,6 +2789,9 @@ name such as `redirect:/myapp/some/resource` will redirect relative to the curre ...@@ -2789,6 +2789,9 @@ name such as `redirect:/myapp/some/resource` will redirect relative to the curre
Servlet context, while a name such as `redirect:http://myhost.com/some/arbitrary/path` Servlet context, while a name such as `redirect:http://myhost.com/some/arbitrary/path`
will redirect to an absolute URL. will redirect to an absolute URL.
Note that the controller handler is annotated with the `@ResponseStatus`, the annotation
value takes precedence over the response status set by `RedirectView`.
[[mvc-redirecting-forward-prefix]] [[mvc-redirecting-forward-prefix]]
==== The forward: prefix ==== The forward: prefix
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册