spring-framework / org.springframework.web.bind.annotation / RestControllerAdvice / basePackages

basePackages

@AliasFor("value") val basePackages: Array<String>

Array of base packages.

Controllers that belong to those base packages or sub-packages thereof will be included, e.g.: @ControllerAdvice(basePackages="org.my.pkg") or @ControllerAdvice(basePackages={"org.my.pkg", "org.my.other.pkg"}).

#value is an alias for this attribute, simply allowing for more concise use of the annotation.

Also consider using #basePackageClasses() as a type-safe alternative to String-based package names.