Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

send some dummy response to client while keep executing current jsp page  RSS feed

 
venkat gubbala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JSP page is retrieving large amount data from data base. The database interation is happening through C++. while I am getting response from C++, Proxy is reaching time out time and its giving time out message.
Is there any way in JSP to send some dummy response to client so that I can stop the proxy from timeout, until I get data from database. Here I intract with my application server though a Proxy server.
Once I send some response to client using some jsp page say dummy.jsp it is going out from my current jsp page. Is there way like send some response to client and actual JSP page executes its normal flow.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a case like this, I would kick of the long running process in a separate thread and immediately forward/redirect to a status page that refreshes every n seconds.
With each refresh, it should check on the status of the process. If it's going to take more than 30 or so seconds, the user should be able to leave and check the status page later to see if the report has completed. Also if it's going to take a real long time, it's a good idea to send the user an email when the report is finished so they don't have to keep coming back to check it.

I have a small demo app that does some of this on my site:
http://simple.souther.us/not-so-simple.html
Look for "LongRunningProcess".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!