详细解决方案
servlet3长连接有关问题
热度:4521 发布时间:2013-02-25 21:12:34
servlet3长连接问题?
Java codepublic void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { resp.setContentType("text/html;charset=UTF-8"); AsyncContext ctx = req.startAsync(); ctx.setTimeout(100000000); new Thread(new Executor(ctx)).start(); }
提示startAsync() is undefined for the type HttpServletRequest
怎么解决啊??????我下载了很多示例,导入后都提示这个错误????
------解决方案--------------------------------------------------------你的中间件是啥?什么版本?。。。应该它不支持Servlet3吧?
考虑使用新版本的,支持Servlet3的中间件。