• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

Spring MVC receiving entity from ajax as List<Issue> use beside controller

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have made spring which accepts POST request with JSON data in body. I am getting deserialized List by sending ajax through my thymeleaf. (most of logic is javascript rest API, which I am consuming and passing further to Spring, currently after controller returns new html with extensionSearch I am loading new html in success branch of ajax function.)

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.
    Bookmark Topic Watch Topic
  • New Topic