我正在调用实现CometProcessor接口的servlet,每当我尝试使用get请求调用servlet时,我都会遇到上述错误。我可以知道原因吗?
public class ChatServlets
extends HttpServlet implements CometProcessor {
public void event(CometEvent event)
throws IOException, ServletException {
HttpServletRequest request = event.getHttpServletRequest();
HttpServletResponse response = event.getHttpServletResponse();
if (event.getEventType() == CometEvent.EventType.BEGIN) {
response.getWriter().println("Welcome ");
} else if (event.getEventType() == CometEvent.EventType.READ) {
response.getWriter().println("Bye");
}
}
}
答案 0 :(得分:1)
重要说明:使用这些功能需要使用APR或NIO HTTP连接器。经典的java.io HTTP连接器和AJP连接器不支持它们。
默认情况下,您可以在server.xml中配置经典的java.io HTTP连接器。你有没有把它改成NIO连接器?