• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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

 
Greenhorn
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.
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic