The value for annotation attribute PageableDefault.size must be a constant expression

ⅰ亾dé卋堺 提交于 2019-12-23 02:29:18

问题


I already went through many links but did not find solution. Here is my code:

@Value("${paging.default.pageSize}")
public int pageSize;

Controller method:

@GetMapping()
public ResponseEntity<Page<Employee>> getAllEmployee(@PageableDefault(size = pageSize) Pageable pageable) {
    return countryService.findAllCountries(pageParams, pageable);
}

The value for annotation attribute PageableDefault.size must be a constant expression

来源:https://stackoverflow.com/questions/56107812/the-value-for-annotation-attribute-pageabledefault-size-must-be-a-constant-expre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!