PageRenderTime 23ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/1.1/src/main/webapp/countdown.jsp

http://jquery-stream.googlecode.com/
JavaServer Pages | 27 lines | 23 code | 4 blank | 0 comment | 4 complexity | bf07e115b16679ab7e302bdd5331d62a MD5 | raw file
 1<%
 2	if ("GET".equals(request.getMethod())) {
 3		if ("websocket".equalsIgnoreCase(request.getHeader("Upgrade"))) {
 4			response.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED);
 5			return;
 6		}
 7		
 8		response.setContentType("text/plain");
 9		response.setHeader("Access-Control-Allow-Origin", "*");
10
11		out.print(java.util.UUID.randomUUID());
12		out.print(';');
13
14		for (int i = 0; i < 1024; i++) {
15			out.print(' ');
16		}
17		out.print(';');
18		out.flush();
19
20		for (int i = 10; i > 0; i--) {
21			Thread.sleep(1000);
22			String message = String.valueOf(i);
23			out.print(message.length() + ";" + message + ";");
24			out.flush();
25		}
26	}
27%>