Browse Source

Update @RestController javadoc

Issue: SPR-13945
pull/1064/head
Rossen Stoyanchev 10 years ago
parent
commit
400206a2fe
  1. 6
      spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
  2. 14
      spring-web/src/main/java/org/springframework/web/bind/annotation/RestController.java
  3. 10
      spring-web/src/main/java/org/springframework/web/bind/annotation/RestControllerAdvice.java

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

@ -29,10 +29,10 @@ import org.springframework.core.annotation.AliasFor; @@ -29,10 +29,10 @@ import org.springframework.core.annotation.AliasFor;
*
* <p>By default, all origins and headers are permitted.
*
* <p><b>NOTE:</b> {@code @CrossOrigin} will only be processed if an appropriate
* <p><b>NOTE:</b> {@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.

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

@ -1,5 +1,5 @@ @@ -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; @@ -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}.
* <p>
* Types that carry this annotation are treated as controllers where
* {@link RequestMapping @RequestMapping} methods assume
* {@link ResponseBody @ResponseBody} semantics by default.
*
* <p><b>NOTE:</b> {@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

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

@ -1,5 +1,5 @@ @@ -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; @@ -34,6 +34,14 @@ import org.springframework.core.annotation.AliasFor;
* {@link ExceptionHandler @ExceptionHandler} methods assume
* {@link ResponseBody @ResponseBody} semantics by default.
*
* <p><b>NOTE:</b> {@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
*/

Loading…
Cancel
Save