I need make some sort of pagination with spring I have found some guide https://www.baeldung.com/spring-thymeleaf-pagination, but need to access my data in other classes like in guide BookService, I want create Service class for this purpose, where I would access this data from receiving controller. Can I in some way autowire this instance without storing it into database first? I have access to List<Issue> only from controller. I expect that in my @Service class I access these data from spring controller, and implement pagination. The Issue is implemented like record POJO with Java 15.
I have also splited first 10 issues rest, which I am sending through aformentioned @RequestMapping and then another rest for all other issues /receiveNextIssues, where I want implement pagination in Java and then in jquery after onclick call another rest for chosen page like /listIssues?page=5 like in guide.