peter
peter

Reputation: 61

spring MVC errors : Could not instantiate bean class [org.springframework.data.domain.Pageable]: Specified class is an interface

I want to pagination in Spring MVC but getting error : Could not instantiate bean class [org.springframework.data.domain.Pageable]: Specified class is an interface . Anyone can help? thanks!

Upvotes: 6

Views: 3835

Answers (1)

Biju Kunjummen
Biju Kunjummen

Reputation: 49935

To resolve Pageable parameters, Spring MVC uses a component called a HandlerMethodArgumentResolver(reference here). Specifically for Pageable as parameter, HandlerMethodArgumentResolver used is org.springframework.data.web.PageableHandlerMethodArgumentResolver, this can be registered using Java Configuration by just adding the @EnableSpringDataWebSupport annotation.

More options are available here: http://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#core.web

Upvotes: 8

Related Questions