Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当响应时间超过2分钟时,Jsp变为空_Jsp - Fatal编程技术网

当响应时间超过2分钟时,Jsp变为空

当响应时间超过2分钟时,Jsp变为空,jsp,Jsp,当响应时间超过2分钟时,Jsp将变为空,我正在使用tomcat 6 EC2和struts 1.3,如何使用Ajax函数解决问题 这段代码应该对某人有所帮助 此功能可帮助您解决此问题 当调用Ajax函数时,结果的执行在不同的页面中完成,结果按您的意愿放置在div、td、li等中 function ajax(x) { document.getElementById("divresult").innerHTML = ""; if (window.XMLHttpRequest)

当响应时间超过2分钟时,Jsp将变为空,我正在使用tomcat 6 EC2和struts 1.3,如何使用Ajax函数解决问题

这段代码应该对某人有所帮助

此功能可帮助您解决此问题 当调用Ajax函数时,结果的执行在不同的页面中完成,结果按您的意愿放置在div、td、li等中

function ajax(x)
{    
   document.getElementById("divresult").innerHTML = "";
   if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp = new XMLHttpRequest();
   }
   else
   {// code for IE6, IE5
       xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   }
   xmlhttp.onreadystatechange = function ()
   {//4=request finished and response is ready,0=request not initialized,1=server connection established,2=request received,3=processing request      status 200=ok,404=page not found
       if (xmlhttp.readyState === 4 && xmlhttp.status === 200)
       {
           document.getElementById("divresult").innerHTML = xmlhttp.responseText;
           // alert(xmlhttp.responseText);
       }
   }
   xmlhttp.open("GET", "action_page.jsp?q=" + x, true);
   //x is the value you pass to the action page
   xmlhttp.send();
}

响应后是重新加载还是页面始终为空?不总是,对于超过2分钟的大数据,则页面变为空,当查询在日志中打印时,加载查询结果的方式jspRequest转到struts并在action类中获取数据,然后转发到jsp页面,如果数据需要更多的时间,那么页面将变为空白,否则没有问题。使用ajax请求而不是表单提交我们可以这样做,但会有重大变化,我们可以增加jsp页面的响应时间吗?