Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- {
- HttpSession session = request.getSession();
- System.out.println("Session " + session.getId() + " started");
- response.setContentType("text/html;charset=UTF-8");
- PrintWriter out = response.getWriter();
- try
- {
- while (!out.checkError())
- {
- try
- {
- Thread.sleep(1000);
- } catch (InterruptedException ex)
- {
- ex.printStackTrace();
- }
- Date date = new Date();
- // TODO append output to the client browser here
- out.println(".....");
- System.out.println("Session " + session.getId() + "data sent at: " + date);
- out.flush();
- //break; // _TEST
- }
- } finally
- {
- System.out.println("Session " + session.getId() + " finished");
- out.close();
- }
- }
Add Comment
Please, Sign In to add comment