Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts with AJAX pagination

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse Me, I want to do pagination using Struts with Ajax. Please give me Idea.

THanks
Edward
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a Struts Action that displays the first page. Create a pagination JavaBean and store it in the HttpSession that keeps track of what page you're on, number of rows per page, etc. Then, when the user wishes to page forward or back, make an AJAX call to the server, retrieve the pagination bean from the session, and get the data for the selected page. Then, use JavaScript and the DOM to replace the data on the page with the newly retrieved data.
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. If you have any sample pls send me.

edward_durai@hotmail.com

Thanks
edward
 
vijay Mamilla
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have any sample pls send me.

vj08820@yahoo.com

Thanks
Vijay Mamilla
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, Vijay, I don't have a specific example of this.
 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Edward,

Have you tried how to develop a AJAX call till now.
If you are not , do it as first exercise.

If you have the basic idea how to implement AJAX ,
then you can come on to your requirement.

I have the code, for different requirements,
like you can send the data by using
1) XML
2) HTML
3) HTML through the forwarded JSP into Original JSP

in these three ways we can solve the problems.

In your case you are better to go with the 3) one

First you try with small example of AJAX , then you can send a mail to me

at murali.k.krishna@verizon.com then i can help you in remain thing.

All the best
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic