I have a spring controller and a query matching method.
@RequestMapping(value = { "/doSomething.do" }) public ModelAndView emailToNonBelievers(){ ..... // do something which takes lot of time // send response.. return modelAndView; }
This method takes a very long time, about an hour. (This is for the administrator, not for users. And the administrator does not need to wait an hour. Just shoot and forget, this is normal. And this is not a batch task)
But I found that the client resubmit requests at intervals of 3 minutes (observed 6 times, and I stopped the spring service).
I think because the client did not receive any response from the server.
If my guess is correct, the server should respond like "Your request has been accepted, just shut up and wait!",
But how to send a response (200 ok) before completing tasks in Spring?
Or am I missing something?
spring header
Deckard Nov 19 '14 at 5:14 2014-11-19 05:14
source share