Reputation: 23
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 running process:
What I want to try to do:
I want that in each iteration of the loop I send an information to the VIEW and that the jquery function with the calling request is able to render that information in a DIV tag.
If anyone can tell me some tutorial about it would be grateful.
Upvotes: 1
Views: 66
Reputation: 440
HTTP is limited to one response per one request.
You can break the controller method, and adapt it to multiple requests that are necessary, if you want to have multiple responses. You would have to create some kind of iterator to keep up with this.
On this point you have to consider if it's really worth it, and if it is, reorganize the jQuery code too.
Upvotes: 1