读书人

servlet3长连接有关问题

发布时间: 2012-09-08 10:48:07 作者: rapoo

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的中间件。

读书人网 >Java Web开发

热点推荐