Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 451
peter Avatar asked Jul 29 '14 10:07

peter


1 Answers

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

like image 71
Biju Kunjummen Avatar answered Oct 26 '22 22:10

Biju Kunjummen