Partheban Udayakumar wrote:I didn't know what to do so I hard coded it to 0. So we will have to retrieve the page number and pass it to the method is it?
When you're not sure, don't hardcode anything. In fact, stop all coding and think logically. These are computers - they follow a logical sequence. Think like them, and the pieces fall into place.
Forget about jquery, datatables, spring and PagingAndSortingRepository, and start thinking about the sequence:
Only way for server to know current page number is for client to pass it. If you hardcode that to 0 on server side, it's bound to always return the first page of results!