This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 178428
Collapse All | Expand All

(-)a/src/java/web/servlet/async_request_war/AjaxCometServlet.java (-5 / +8 lines)
Lines 109-124 Link Here
109
        res.setContentType("text/html");
109
        res.setContentType("text/html");
110
        res.setHeader("Cache-Control", "private");
110
        res.setHeader("Cache-Control", "private");
111
        res.setHeader("Pragma", "no-cache");
111
        res.setHeader("Pragma", "no-cache");
112
        
112
113
        PrintWriter writer = res.getWriter();
113
        PrintWriter writer = res.getWriter();
114
        // for IE
114
        // for IE
115
        writer.println("<!-- Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. -->\n");
115
        writer.println("<!-- Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. -->\n");
116
        writer.flush();
116
        writer.flush();
117
118
        req.setAsyncTimeout(10 * 60 * 1000);
119
        final AsyncContext ac = req.startAsync();
117
        final AsyncContext ac = req.startAsync();
120
        queue.add(ac);
118
        ac.setTimeout(10 * 60 * 1000);
121
        req.addAsyncListener(new AsyncListener() {
119
        ac.addListener(new AsyncListener() {
122
            public void onComplete(AsyncEvent event) throws IOException {
120
            public void onComplete(AsyncEvent event) throws IOException {
123
                queue.remove(ac);
121
                queue.remove(ac);
124
            }
122
            }
Lines 129-135 Link Here
129
127
130
            public void onError(AsyncEvent arg0) throws IOException {
128
            public void onError(AsyncEvent arg0) throws IOException {
131
            }
129
            }
130
131
            public void onStartAsync(AsyncEvent event) throws IOException {
132
            }
133
132
        });
134
        });
135
        queue.add(ac);
133
    }
136
    }
134
137
135
    @Override
138
    @Override

Return to bug 178428