File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
spring-web/src/main/java/org/springframework/web/bind/annotation Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 32
32
* <p>The status code is applied to the HTTP response when the handler
33
33
* method is invoked.
34
34
*
35
- * <p><strong>Note: </strong> when using this annotation on an exception class,
36
- * or when setting the {@code reason} attribute of the annotation,
35
+ * <p><strong>Warning </strong>: when using this annotation on an exception
36
+ * class, or when setting the {@code reason} attribute of this annotation,
37
37
* the {@code HttpServletResponse.sendError} method will be used.
38
38
*
39
- * With {@code HttpServletResponse.sendError}, the response is considered
40
- * complete and should not be written to any further.
41
- * Furthermore servlet container will typically write an HTML error page
42
- * therefore making the use of a reason unsuitable for REST APIs.
43
- * For such cases prefer the use of {@link org.springframework.http.ResponseEntity}
44
- * as a return type and avoid {@code ResponseStatus} altogether.
39
+ * <p> With {@code HttpServletResponse.sendError}, the response is considered
40
+ * complete and should not be written to any further. Furthermore, the Servlet
41
+ * container will typically write an HTML error page therefore making the
42
+ * use of a {@code reason} unsuitable for REST APIs. For such cases it is
43
+ * preferable to use a {@link org.springframework.http.ResponseEntity} as
44
+ * a return type and avoid the use of {@code @ ResponseStatus} altogether.
45
45
*
46
46
* @author Arjen Poutsma
47
47
* @author Sam Brannen
You can’t perform that action at this time.
0 commit comments