Annotation Interface EnableSpringDataWebSupport
@Retention(RUNTIME)
@Target({TYPE,ANNOTATION_TYPE})
@Inherited
@Import({SpringDataWebConfigurationImportSelector.class,QuerydslActivator.class,SpringDataWebSettingsRegistar.class})
public @interface EnableSpringDataWebSupport
Annotation to automatically register the following beans for usage with Spring MVC. Note that using this annotation
will require Spring 3.2.
DomainClassConverter
- to allow usage of domain types managed by Spring Data repositories as controller method arguments bound withPathVariable
orRequestParam
.PageableHandlerMethodArgumentResolver
- to allow injection ofPageable
instances into controller methods automatically created from request parameters.SortHandlerMethodArgumentResolver
- to allow injection ofSort
instances into controller methods automatically created from request parameters.
HateoasPageableHandlerMethodArgumentResolver
- instead ofPageableHandlerMethodArgumentResolver
HateoasSortHandlerMethodArgumentResolver
- instead ofSortHandlerMethodArgumentResolver
PagedResourcesAssembler
- for injection into web componentsSortHandlerMethodArgumentResolver
- for injection ofPagedResourcesAssembler
into controller methods
- Since:
- 1.6
- Author:
- Oliver Gierke, Yanming Zhou
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
Import selector to registerQuerydslWebConfiguration
as configuration class if Querydsl is on the classpath.static class
Import selector to import the appropriate configuration class depending on whether Spring HATEOAS is present on the classpath.static class
Registers a bean definition forSpringDataWebSettings
carrying the configuration values ofEnableSpringDataWebSupport
. -
Optional Element Summary
-
Element Details
-
pageSerializationMode
EnableSpringDataWebSupport.PageSerializationMode pageSerializationModeConfigures how to renderPageImpl
instances. Defaults toEnableSpringDataWebSupport.PageSerializationMode.DIRECT
for backward compatibility reasons. Prefer explicitly setting this toEnableSpringDataWebSupport.PageSerializationMode.VIA_DTO
, or manually convertPageImpl
instances before handing them out of a controller method, either by manually callingnew PagedModel<>(page)
or using Spring HATEOASPagedModel
abstraction.- Returns:
- will never be null.
- Since:
- 3.3
- Default:
- DIRECT
-