解决办法:
ajax添加timeout时长,60000为60秒
$.ajax({
timeout: 60000,
url: xxxxxxxxx,
type: "post",
success: function(data) {
xxxxxxxxxxx
}
});
tomcat配置文件bin/server.xml里connector标签添加keepalive属性,maxKeepAliveRequests为支持最大请求数,超过的请求数将关闭,-1表示没有限制,keepAliveTimeout表示超时时长,60000为60秒
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="60000"
redirectPort="8443"
maxKeepAliveRequests="-1"
keepAliveTimeout="60000"/>
*注意协议版本:HTTP/1.1