When I'm sending a request like getUserPlaces?page=0&size=5
I get this error:
Failed to instantiate [org.springframework.data.domain.Pageable]: Specified class is an interface
My controller is:
@Controller
@EnableSpringDataWebSupport
public class UserController {
...
@RequestMapping(value = "/getUserPlaces", method = RequestMethod.POST)
public @ResponseBody List<PlaceDto> getUserPlaces(@RequestBody RoutePagingDto routeRequest, Pageable pageable) {
return placeService.placeToPlaceDto(userService.getUserPlaces(pageable));
}
In my spring-context.xml I have them declared beans:
<beans:bean class="org.springframework.data.web.SortHandlerMethodArgumentResolver" />
<beans:bean class="org.springframework.data.web.PageableHandlerMethodArgumentResolver" />
What I'm missing?
Remove
@EnableSpringDataWebSupport
from UserController class and create WebConfig class with the following code