I am designing a search functionality with the below flow:
1) User enters search criteria and clicks on search
2) Once the user clicks on search it will come to server componenet(Servlet) where the search operation is done
3) Results will be returned to users
In the above case the data size which should be returned is huge and it takes lot of time to get all the results. So sending all the data at a time is not an option as it will affect the performance.
I am planning to send the data multiple times by querying small chunks of data and sending them, so that user can see the results which are returned and others will be refreshed while they are seeing the displayed data.
I need to do in struts2 but for this multiple return i am ok to go with a servlet as well. Is there any way to build it in struts2 or through a servlet in an efficient way. If sending the data in small chunks is a good way then what are the efficient ways to achieve that.
Thanks for the quick response Bear Bibeault. I was thinking to avoid Ajax, if what i am thinking is wrong and going with Ajax is the correct way then i will go with that.
I will check if there is a way i can use ajax with struts2, other wise I will go with a servlet for this.