servlet3长连接问题?
- Java code
public 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的中间件。