java - Solution for Asynchronous Servlets in versions prior to 3.0? -
i have long-running task (report) exceed tcp connection timeouts before starts returning data. asynchronous servlets (introducted in servlets 3.0) need, limited servlet v2.4. there "roll-your-own" solutions? i'm doing feels hacked - kick off task asynchronously in thread , return client immediately. client polls every few seconds (with ajax), , checks "ready" status task id (a static list maintains status , handles objects processed thread). once ready, inject output stream work object thread can write results client.
you can implement reverse ajax technique means instead of polling many times response response once task has finished. there quick solution implement reverse-ajax technique using dwr here. should maintain use of static list. if background task business logic complicated can use esb or more sophisticated.
Comments
Post a Comment