Finishing a HttpServletResponse but continue processing

后端 未结 4 1123
不思量自难忘°
不思量自难忘° 2021-02-15 11:14

I have a situation that seems to fit the Async Servlet 3.0 / Comet situation but all I need to do is return a 200 response code (or other) after accepting the incoming parameter

4条回答
  •  孤独总比滥情好
    2021-02-15 12:10

    This example can help

    void doPost(){
        // do something
       final ExecutorService executor = Executors.newSingleThreadExecutor();
          executor.execute(new Runnable() {
              @Override
              public void run() {
                  // processing after response
              }
          });}
    

提交回复
热议问题