Annotation Interface EnableSpringDataWebSupport
@Retention(RUNTIME)
@Target({TYPE,ANNOTATION_TYPE})
@Inherited
@Import({SpringDataWebConfigurationImportSelector.class,QuerydslActivator.class,SpringDataWebSettingsRegistrar.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 withPathVariableorRequestParam.PageableHandlerMethodArgumentResolver- to allow injection ofPageableinstances into controller methods automatically created from request parameters.SortHandlerMethodArgumentResolver- to allow injection ofSortinstances into controller methods automatically created from request parameters.
HateoasPageableHandlerMethodArgumentResolver- instead ofPageableHandlerMethodArgumentResolverHateoasSortHandlerMethodArgumentResolver- instead ofSortHandlerMethodArgumentResolverPagedResourcesAssembler- for injection into web componentsSortHandlerMethodArgumentResolver- for injection ofPagedResourcesAssemblerinto controller methods
- Since:
- 1.6
- Author:
- Oliver Gierke, Yanming Zhou
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classImport selector to registerQuerydslWebConfigurationas configuration class if Querydsl is on the classpath.static classImport selector to import the appropriate configuration class depending on whether Spring HATEOAS is present on the classpath.static classRegisters a bean definition forSpringDataWebSettingscarrying the configuration values ofEnableSpringDataWebSupport. -
Optional Element Summary
Optional Elements
-
Element Details
-
pageSerializationMode
EnableSpringDataWebSupport.PageSerializationMode pageSerializationModeConfigures how to renderPageImplinstances. Defaults toEnableSpringDataWebSupport.PageSerializationMode.DIRECTfor backward compatibility reasons. Prefer explicitly setting this toEnableSpringDataWebSupport.PageSerializationMode.VIA_DTO, or manually convertPageImplinstances before handing them out of a controller method, either by manually callingnew PagedModel<>(page)or using Spring HATEOASPagedModelabstraction.- Returns:
- will never be null.
- Since:
- 3.3
- Default:
- DIRECT
-