Annotation Interface FrameworkController


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface FrameworkController
Indicates that an annotated class is a "Framework Controller" (default MVC controller).

This means that if EnableFrameworkControllers or EnableAllFrameworkControllers is included in the application configuration then classes annotated with FrameworkController will be component scanned and included in the application context and that FrameworkMappings will be added to handler mappings with a lower priority than RequestMappings found within a class annotated with Controller. This priority is achieved through FrameworkControllerHandlerMapping having a higher order value than RequestMappingHandlerMapping.

The intention is that you are able to specify MVC controllers and mappings within a framework module as the default MVC mappings and a client application can essentially override those mappings without causing an ambiguous mapping exception.

The site handler mappings in play in order of precedence from highest to lowest are:

  1. RequestMappingHandlerMapping
  2. FrameworkControllerHandlerMapping

The admin handler mappings in play in order of precedence from highest to lowest are:

  1. AdminRequestMappingHandlerMapping
  2. FrameworkControllerHandlerMapping
  3. AdminControllerHandlerMapping

This concept was adapted from @FrameworkEndpoint from Spring Security OAuth 2.

Since:
5.2
Author:
Philip Baggett (pbaggett)
See Also: