Annotation Interface RepositoryRestController


@Documented @Component @Retention(RUNTIME) @Target({TYPE,ANNOTATION_TYPE}) @BasePathAwareController public @interface RepositoryRestController
Annotation to demarcate Spring MVC controllers provided by Spring Data REST. Allows to easily detect them and exclude them from standard Spring MVC handling.

Note, that this annotation should only be used by application controllers that map to URIs that are managed by Spring Data REST as they get handled by a special HandlerMapping implementation that applies additional functionality:

  • CORS configuration defined for the repository backing the path.
  • An OpenEntityManagerInViewInterceptor for JPA backed repositories so that properties can always be accessed.
Author:
Oliver Gierke, Yves Galante
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The root path to be prepended to all request mappings configured on handler methods.
    The root path to be prepended to all request mappings configured on handler methods.
  • Element Details

    • value

      @AliasFor(attribute="value", annotation=BasePathAwareController.class) String[] value
      The root path to be prepended to all request mappings configured on handler methods.
      Returns:
      Since:
      3.7.2
      See Also:
      Default:
      {}
    • path

      @AliasFor(attribute="path", annotation=BasePathAwareController.class) String[] path
      The root path to be prepended to all request mappings configured on handler methods.
      Returns:
      Since:
      3.7.2
      See Also:
      Default:
      {}