• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using struts pagination logic with Spring MVC

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am trying to do pagination with Spring MVC. I want to reuse the same logic that I had for an application I did with Struts. Now in Struts my JSP would submit the form with all the paging parameters to the Sturts Action. In the execute method of the Struts action I would use those parameters to get the correct result set from my back end and then forward back to the same JSP. This was possible because in Struts there was only one method which both loaded the data and handled submits (the execute method)

Now in Spring MVC there are 2 methods. One is onSubmit which handles submits and the other is referenceData which loads your data. So my pagination logic hits a snag here. My parameters are avaliable in the onSubmit method but I lose these parameters in the referenceData method (this is where I need them because this is where I load the data). The request parameters are avaliable in onSubmit but not in referenceData.

Anyone have any ideas on how I could persist these parameters into the referenceData method without using the session.

Thanks in advance for any suggestions.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are actually three methods. referenceData is only that, for reference data, like States for a dropdown. Not dynamic data that changes on a form submit.

So there is a setup method, which I can't remember the name. That will start you pagination first page and set the parameters to hold which page/record number you are on. Then the onSubmit handles the paging submitals.

Mark
 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Thanks for your reply. Could you tell me the name of this method you mentioned, I don't recall reading about it.

Thanks,
Jehan
 
reply
    Bookmark Topic Watch Topic
  • New Topic