如何检查网页是否挂起(继续加载)?

时间:2021-11-12 01:15:25

I'm trying to write a java class to check if the webpage interface of my Maximo application is fully loaded or hanging. If it's hanging then a restart script will be run to restart the application.

我正在尝试编写一个java类来检查我的Maximo应用程序的网页界面是完全加载还是挂起。如果它挂起,则将运行重新启动脚本以重新启动应用程序。

I can check the application up or down (using Maximo connect()) but don't know how to do the same for the webpage interface because sometimes I can connect() to the application but the webpage is not responding, it's just keep loading on the browser.

我可以向上或向下检查应用程序(使用Maximo connect())但不知道如何为网页界面做同样的事情,因为有时我可以连接()到应用程序但网页没有响应,它只是继续加载在浏览器上。

Basically, I need a way to try loading the application URL, if after 5 minutes, it's still loading then restart the server.

基本上,我需要一种方法来尝试加载应用程序URL,如果在5分钟后,它仍在加载,然后重新启动服务器。

Thanks.

1 个解决方案

#1


0  

You answered your own question:

你是在自问自答:

Basically, I need a way to try loading the application URL, if after 5 minutes, it's still loading then restart the server.

基本上,我需要一种方法来尝试加载应用程序URL,如果在5分钟后,它仍在加载,然后重新启动服务器。

Unless you have a side channel of some sort the only way to tell is a timeout.

除非你有某种侧面通道,否则唯一的方法是超时。

#1


0  

You answered your own question:

你是在自问自答:

Basically, I need a way to try loading the application URL, if after 5 minutes, it's still loading then restart the server.

基本上,我需要一种方法来尝试加载应用程序URL,如果在5分钟后,它仍在加载,然后重新启动服务器。

Unless you have a side channel of some sort the only way to tell is a timeout.

除非你有某种侧面通道,否则唯一的方法是超时。