Annotation Interface EnableFrameworkRestControllers


@Target(TYPE) @Retention(RUNTIME) @Documented @ComponentScan(useDefaultFilters=false, basePackages={"org.broadleafcommerce","com.broadleafcommerce"}, includeFilters=, nameGenerator=BroadleafBeanNameGenerator.class) public @interface EnableFrameworkRestControllers
Enables only FrameworkRestController annotations, which are the RESTful controllers.

If you desire all of Broadleaf's default controllers, including the MVC ones, then use EnableAllFrameworkControllers instead.

Scan all Broadleaf modules for FrameworkRestController so that their FrameworkMappings will get included in FrameworkControllerHandlerMapping to provide default implementations of web endpoints.

If only some FrameworkRestControllers are desired, then use excludeFilters() to disable undesired default controllers.

DO NOT place this annotation on the same class as another ComponentScan or other annotations that compose ComponentScan such as @SpringBootApplication and EnableFrameworkControllers as they will conflict when Spring performs annotation composition. Instead, you can create a nested class in your @SprintBootApplication class like this:

 
 @literal @SpringBootApplication
 public class MyApplication {

     @literal @EnableFrameworkRestControllers
     public static class EnableBroadleafRestControllers {}

     public static void main(String[] args) {
         SpringApplication.run(MyApplication.class, args);
     }
 }
 
 
Since:
5.2
Author:
Philip Baggett (pbaggett)
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.springframework.context.annotation.ComponentScan.Filter[]
    A set of ComponentScan.Filters that describe classes to exclude from component scanning.
  • Element Details

    • excludeFilters

      @AliasFor(annotation=org.springframework.context.annotation.ComponentScan.class, attribute="excludeFilters") org.springframework.context.annotation.ComponentScan.Filter[] excludeFilters
      A set of ComponentScan.Filters that describe classes to exclude from component scanning.

      This is most useful when you want to enable some framework controllers but exclude others. You can exclude classes annotated with FrameworkRestController by providing a filter like @EnableFrameworkRestControllers(excludeFilters = @Filter(value = DefaultCustomerRestController.class, type = FilterType.ASSIGNABLE_TYPE))

      See Also:
      • ComponentScan.excludeFilters()
      • ComponentScan.Filter
      Default:
      {}