diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java index cd14c5a17bb..76aacd0a473 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java @@ -29,10 +29,10 @@ import org.springframework.core.annotation.AliasFor; * *

By default, all origins and headers are permitted. * - *

NOTE: {@code @CrossOrigin} will only be processed if an appropriate + *

NOTE: {@code @CrossOrigin} is processed if an appropriate * {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the - * {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} pair - * which are the default in the MVC Java config and the MVC namespace. + * {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} + * pair which are the default in the MVC Java config and the MVC namespace. * In particular {@code @CrossOrigin} is not supported with the * {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter} * pair both of which are also deprecated. diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java index cdd3772b60c..2287f65264f 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 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. @@ -25,13 +25,21 @@ import java.lang.annotation.Target; import org.springframework.stereotype.Controller; /** - * A convenience annotation that is itself annotated with {@link Controller @Controller} - * and {@link ResponseBody @ResponseBody}. + * A convenience annotation that is itself annotated with + * {@link Controller @Controller} and {@link ResponseBody @ResponseBody}. *

* Types that carry this annotation are treated as controllers where * {@link RequestMapping @RequestMapping} methods assume * {@link ResponseBody @ResponseBody} semantics by default. * + *

NOTE: {@code @RestController} is processed if an appropriate + * {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the + * {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} + * pair which are the default in the MVC Java config and the MVC namespace. + * In particular {@code @RestController} is not supported with the + * {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter} + * pair both of which are also deprecated. + * * @author Rossen Stoyanchev * @author Sam Brannen * @since 4.0 diff --git a/spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java b/spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java index 4dca5e36300..29b080762b5 100644 --- a/spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java +++ b/spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -34,6 +34,14 @@ import org.springframework.core.annotation.AliasFor; * {@link ExceptionHandler @ExceptionHandler} methods assume * {@link ResponseBody @ResponseBody} semantics by default. * + *

NOTE: {@code @RestControllerAdvice} is processed if an appropriate + * {@code HandlerMapping}-{@code HandlerAdapter} pair is configured such as the + * {@code RequestMappingHandlerMapping}-{@code RequestMappingHandlerAdapter} pair + * which are the default in the MVC Java config and the MVC namespace. + * In particular {@code @RestControllerAdvice} is not supported with the + * {@code DefaultAnnotationHandlerMapping}-{@code AnnotationMethodHandlerAdapter} + * pair both of which are also deprecated. + * * @author Rossen Stoyanchev * @since 4.3 */