简体   繁体   English

响应处理完成之前的错误页面

[英]Error Page before response processing finishes

I have certain use case where processing can take upto 2 hrs of time. 我有一定的用例,处理可能要花费2个小时的时间。 so once user submit the request from browser, my understanding was browser would keep on waiting for response to arrive. 因此,一旦用户从浏览器提交请求,我的理解是浏览器将继续等待响应到达。 But I get error page after some 15-20 mins. 但是约15-20分钟后,我得到了错误页面。

I understand that web request should not so much time consuming, but i stuck with the existing architecture and design. 我了解Web请求应该不会花费很多时间,但是我坚持使用现有的体系结构和设计。

Can some one suggest some solution for this problem. 有人可以为这个问题提出一些解决方案吗?

I am using IE 9 as browser. 我正在使用IE 9作为浏览器。 Tomcat as server. Tomcat作为服务器。

Most probably the server timeout is about 15 min, therefore you get the error after 15 min. 服务器超时很可能约为15分钟,因此15分钟后您会收到错误消息。 One solution is to increase the server timeout. 一种解决方案是增加服务器超时。 But increasing to 2 hours would be too long. 但是增加到2小时将太长。 Another option is to poll the server from the browser to find out the status of the task. 另一个选择是从浏览器中轮询服务器以找出任务的状态。 You can use ajax call for the purpose. 您可以为此目的使用ajax调用。

What you could do for similar issues is create a separate thread on the server and return a response to the user saying that job has been started and then either 对于类似问题,您可以做的是在服务器上创建一个单独的线程,并向用户返回一条响应,说作业已经启动,然后执行

  • display the result of that job on a specific page (this seems like an acceptable solution, the user will probably not stay in front of his screen for such long task) 在特定页面上显示该工作的结果(这似乎是一个可以接受的解决方案,用户可能不会在如此长的任务前停留在屏幕前)
  • or via ajax do some polling to have the status of the job you just triggered. 或通过ajax进行一些轮询,以获取刚刚触发的作业的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring REST客户端-在方法完成之前强制响应 - Spring REST client - force response before method finishes Spring MVC:如何在返回错误页面/响应之前拦截 404? - Spring MVC: how to intercept 404 before returning error page/response? 在Java Servlet中处理之前发送响应 - Sending response before processing in Java servlet 在Spring中处理请求之前显示等待页面 - Displaying waiting page before processing the request in Spring 代码仅需完成而无需彻底处理 - Code just finishes without thoroughly processing 处理分页 WebClient 响应而无需等待和阻塞 Flux 中的下一页 - Processing paged WebClient response without waiting and blocking for next page in a Flux Javascript,Ajax和JSON:解析响应时出现奇怪的“ xml处理”错误 - Javascript, Ajax & JSON: weird “xml processing” error when parsing response onStart在onCreate之前完成的原因 - Reason why onStart finishes before onCreate EventActionDispatcher 可以在构造函数完成之前发布“this”吗? - Can EventActionDispatcher publish “this” before the constructor finishes? Android AsyncTask - 在 doInBackground 完成之前调用 onPostExecute - Android AsyncTask - onPostExecute called before doInBackground finishes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM