1秒请求1次Servlet 出现 1秒内2次或是3次请求? 400 报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

1秒请求1次Servlet 出现 1秒内2次或是3次请求? 400 报错

爱吃鱼的程序员 2020-05-31 00:22:27 29

1秒请求1次Servlet 出现 1秒内2次或是3次请求? 400 报错

在js中一秒请求一次servlet时,打日志发现

2012-12-21 20:17:11,105  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:update
2012-12-21 20:17:11,106  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.intoEnd(246) [] - intoEnd
2012-12-21 20:17:11,294  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:update
2012-12-21 20:17:11,295  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.intoEnd(246) [] - intoEnd
2012-12-21 20:17:11,308  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:ready
2012-12-21 20:17:11,317  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.ready(269) [] - state:--1 artId:--1149
2012-12-21 20:17:11,335  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.ready(287) [] - art:com.sky.helpcenter.bean.Artificial@3f0ba812 usres:0
2012-12-21 20:17:11,409  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:ready
2012-12-21 20:17:11,418  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.ready(269) [] - state:--1 artId:--1149
2012-12-21 20:17:11,434  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.ready(287) [] - art:com.sky.helpcenter.bean.Artificial@19f9bdc4 usres:0
2012-12-21 20:17:11,511  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:update
2012-12-21 20:17:11,512  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.intoEnd(246) [] - intoEnd
2012-12-21 20:17:11,608  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:update
2012-12-21 20:17:11,608  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.intoEnd(246) [] - intoEnd
2012-12-21 20:17:11,712  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:ready
2012-12-21 20:17:11,720  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.ready(269) [] - state:--1 artId:--1149
2012-12-21 20:17:11,737  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.ready(287) [] - art:com.sky.helpcenter.bean.Artificial@12dc6007 usres:0
2012-12-21 20:17:11,811  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:ready
2012-12-21 20:17:11,820  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.ready(269) [] - state:--1 artId:--1149
2012-12-21 20:17:11,836  WARN [http-80-1] com.sky.helpcenter.servlet.KFServlet.ready(287) [] - art:com.sky.helpcenter.bean.Artificial@1247de8f usres:0
2012-12-21 20:17:11,910  WARN [http-80-2] com.sky.helpcenter.servlet.KFServlet.doGet(51) [] - methodName:update

在一秒内出现2次以上的请求,求原因。

还有个js 中的 

stop=setTimeout("update();",1000);

clearTimeout(stop);

没有,不能实现取消1秒1次请求



JavaScript
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-05-31 00:22:28

    还有个js 中的 

    stop=setTimeout("update();",1000);

    clearTimeout(stop);

    没有,不能实现取消1秒1次请求

     

    这个有运行么?

    ######还有要把你的servlet发出来~~
    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程