标签:
public class ContinuationServlet extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws java.io.IOException { String reqId = req.getParameter("id"); Continuation cc = ContinuationSupport.getContinuation(req,null); res.setContentType("text/plain"); res.getWriter().println("Request: "+reqId+"\tstart:\t"+new Date()); res.getWriter().flush(); cc.suspend(2000); res.getWriter().println("Request: "+reqId+"\tend:\t"+new Date()); } }
相关的文章:
http://www.ibm.com/developerworks/cn/java/j-jettydwr/
http://www.ibm.com/developerworks/cn/java/j-lo-comet/
标签:
原文地址:http://my.oschina.net/u/1462124/blog/484830