Skip to content

Commit 400206a

Browse files
committed
Update @RestController javadoc
Issue: SPR-13945
1 parent a9217d5 commit 400206a

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*
3030
* <p>By default, all origins and headers are permitted.
3131
*
32-
* <p><b>NOTE:</b> {@code @CrossOrigin} will only be processed if an appropriate
32+
* <p><b>NOTE:</b> {@code @CrossOrigin} is processed if an appropriate
3333
* {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the
34-
* {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} pair
35-
* which are the default in the MVC Java config and the MVC namespace.
34+
* {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter}
35+
* pair which are the default in the MVC Java config and the MVC namespace.
3636
* In particular {@code @CrossOrigin} is not supported with the
3737
* {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter}
3838
* pair both of which are also deprecated.

spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,13 +25,21 @@
2525
import org.springframework.stereotype.Controller;
2626

2727
/**
28-
* A convenience annotation that is itself annotated with {@link Controller @Controller}
29-
* and {@link ResponseBody @ResponseBody}.
28+
* A convenience annotation that is itself annotated with
29+
* {@link Controller @Controller} and {@link ResponseBody @ResponseBody}.
3030
* <p>
3131
* Types that carry this annotation are treated as controllers where
3232
* {@link RequestMapping @RequestMapping} methods assume
3333
* {@link ResponseBody @ResponseBody} semantics by default.
3434
*
35+
* <p><b>NOTE:</b> {@code @RestController} is processed if an appropriate
36+
* {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the
37+
* {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter}
38+
* pair which are the default in the MVC Java config and the MVC namespace.
39+
* In particular {@code @RestController} is not supported with the
40+
* {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter}
41+
* pair both of which are also deprecated.
42+
*
3543
* @author Rossen Stoyanchev
3644
* @author Sam Brannen
3745
* @since 4.0

spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,6 +34,14 @@
3434
* {@link ExceptionHandler @ExceptionHandler} methods assume
3535
* {@link ResponseBody @ResponseBody} semantics by default.
3636
*
37+
* <p><b>NOTE:</b> {@code @RestControllerAdvice} is processed if an appropriate
38+
* {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the
39+
* {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} pair
40+
* which are the default in the MVC Java config and the MVC namespace.
41+
* In particular {@code @RestControllerAdvice} is not supported with the
42+
* {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter}
43+
* pair both of which are also deprecated.
44+
*
3745
* @author Rossen Stoyanchev
3846
* @since 4.3
3947
*/

0 commit comments

Comments
 (0)