One way to solve this problem is to make the AJAX way to return HTML instead of simple objects.
You can write a jsp page that will create html for new entries and send html as a response that can be added to the previous content.
Example
Suppose your page looks like
<div class="container"> <div class="record rec-1"> //some html code </div> <div class="record rec-2"> //some html code </div> ..... ..... <div class="record rec-n"> //some html code </div> </div>
Then, when you want to load more content and make an ajax call, let the server return a processed html response, for example
<div class="record rec-n+1"> //some html code </div> <div class="record rec-n+2"> //some html code </div> ..... ..... <div class="record rec-n+k"> //some html code </div>
What you can easily add to container . You can use the jsp page to generate html.
source share