Using Spring MVC I would like to update the view in an AJAX call to a long running method. Sorry if question may seem stupid but I do not know how to find an answer, if someone points me a tutorial how to do it would be extremely grateful.
Current process running:
JSP calls a controller via AJAX
Controller annotated with @ResponseBody executes the task and AT THE END OF THE TASK returns an Object (in this case a Map with success message and number of recorded records) for the calling JQUERY function that displays success or error.
What I want to try to do:
JSP calls a controller via AJAX
Controller annotated with @ResponseBody executes the task and AS I AM PERFORMING THE JOB (actually here I have a WHILE that writes a list of objects in the database, so this while can be time consuming or not depends on the number of objects I want to send a response (but not FINAL) to the view, I wanted to send a partial response for example: for each iteration in the TIE I want to send for example to the view the information: "Object.id"). I do not mind sending a message at the end ...
I want that in each iteration of the loop I send information to the VIEW and that the jquery function with the calling request is able to render this information in a DIV.
If anyone can tell me some tutorial about it would be grateful.